shell脚本中if判断时候-s是什么意思

更新时间:2023-07-08 13:49:37 阅读: 评论:0

shell脚本中if判断时候-s是什么意思-s file     ⽂件⼤⼩⾮0时为真
[ -f "somefile" ] :判断是否是⼀个⽂件
房子风水
[ -x "/bin/ls" ] :判断/bin/ls是否存在并有可执⾏权限
[ -n "$var" ] :判断$var变量是否有值
[ "$a" = "$b" ] :判断$a和$b是否相等
-r file     ⽤户可读为真
从北到南
-w file     ⽤户可写为真
安全手抄报简单-x file     ⽤户可执⾏为真
-f file     ⽂件为正规⽂件为真
-d file     ⽂件为⽬录为真
-c file     ⽂件为字符特殊⽂件为真
-
b file     ⽂件为块特殊⽂件为真方大洪
-s file     ⽂件⼤⼩⾮0时为真    -s file true if the file has nonzero size
-t file     当⽂件描述符(默认为1)指定的设备为终端时为真
-a file exists.
-b file exists and is a block special file.
-c file exists and is a character special file.
-d file exists and is a directory.
-e file exists (just the same as -a).
一年级元宵节手抄报-f file exists and is a regular file.
-g file exists and has its tgid(2) bit t.
马邑之战-G file exists and has the same group ID as this process.
-
k file exists and has its sticky bit t.
面筋的做法
-L file exists and is a symbolic link.
香港百佳超市-n string length is not zero.
-o Named option is t on.
-O file exists and is owned by the ur ID of this process.
-p file exists and is a first in, first out (FIFO) special file or
named pipe.
-r file exists and is readable by the current process.
-s file exists and has a size greater than zero.
-S file exists and is a socket.
-t file descriptor number fildes is open and associated with a
terminal device.
-u file exists and has its tuid(2) bit t.
-w file exists and is writable by the current process.
-x file exists and is executable by the current process.
-z string length is zero.

本文发布于:2023-07-08 13:49:37,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1073032.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:是否   判断   指定
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图