linux shell 判断文件是否存在等符号
来源:互联网 发布:12寸windows平板 编辑:程序博客网 时间:2024/06/05 10:31
-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 setgid(2) bit set.
-G file exists and has the same group ID as this process.
-k file exists and has its sticky bit set.
-L file exists and is a symbolic link.
-n string length is not zero.
-o Named option is set on.
-O file exists and is owned by the user 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 setuid(2) bit set.
-w file exists and is writable by the current process.
-x file exists and is executable by the current process.
-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 setgid(2) bit set.
-G file exists and has the same group ID as this process.
-k file exists and has its sticky bit set.
-L file exists and is a symbolic link.
-n string length is not zero.
-o Named option is set on.
-O file exists and is owned by the user 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 setuid(2) bit set.
-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.
例子:
if [ -f "$LOG/cws_inv.data" ];thenrm $LOG/cws_inv.data fi
注意:文件最好用”“括起来。
0 0
- linux shell 判断文件是否存在等符号
- Linux shell判断文件是否存在
- linux shell 判断文件是否存在
- linux shell 判断文件是否存在
- Linux shell判断文件是否存在
- shell判断文件是否存在
- Shell--判断文件是否存在
- shell判断文件是否存在
- shell判断文件是否存在
- shell判断文件是否存在
- shell 判断文件是否存在
- shell 判断文件是否存在
- shell 判断文件是否存在
- shell判断文件是否存在
- Shell判断文件是否存在
- shell判断文件是否存在
- shell判断文件是否存在
- shell 判断文件是否存在
- 莫比乌斯反演
- 2015 多校联赛 ——HDU5325(DFS)
- Android基础_数据存储二_SharedPreferences存储
- Java 内部类实现原理简单分析
- HDU 2829 Lawrence (斜率优化DP)
- linux shell 判断文件是否存在等符号
- MIPS 指令
- UVALive 6800 The Mountain of Gold (bellman_ford判负环)
- 【Android应用开发技术:应用组件】Fragment使用方法
- URI规范的百分比编码
- CodeForce 424C Magic Formulas
- oracle 怎么查看表空间,求高手指点,可以用PL/SQL查看
- 【asp】on error resume next用法
- yii2 rbac 详解