打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Linux Shell : Test命令参数解析
格式: test conditions
test -n string : string 不为空
test -z string : string 为空

test int1 -eq int2  : int1 == int 2
test int1 -ne int2  : int1 != int2
test int1 -gt int2   : int1 > int2
test int1 -ge int2  : int1 >= int2
test int1 -lt int2    : int1 < int2
test int1 -le int2   : int1 <= int2
test -r filename   : 用户对文件filename有读权限
test -w filename  : 用户对文件filename有写权限
test -x filename   : 用户对文件filename有可执行权限
test -f filename   : 文件filename为普通文件
test -d filename  : 文件filename为目录
test -c filename  : 文件filename为字符设备文件
test -b filename  :文件filename为块设备文件
test -s filename  : 文件filename大小不为零
test -t fnumb      : 与文件描述符fnumb(默认值为1)相关的设备是一个终端设备
test ! -s empty   : empty 为空
test -a       : And
test -o       : Or
注意test命令和[ ]中括号作用是一样的。。
 
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Bourne Shell及shell编程 2
linux常用命令及参数详解
linux命令学习系列10-权限相关chown,chmod,chgrp命令
收藏 | Linux常用实用命令
Linux常用命令详解—基于CentOS7
Windows PowerShell读取文本文件
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服