常用的检查参数如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
操作符 如果...则为真 -b file file 为块设备文件
-c file file 为字符设备文件
-d file file 为目录
-e file file 存在
-f file file 为一般文件
-g file file 有设置它的setgid位
-h file file 为符号链接
-L file 同-h
-p file file 为管道
-r file file 可读
-S file file 为套接字(socket)
-s file file 非空
-u file file 有设置它的setuid位
-w file file 可写
-x file file 可执行,如果是目录,则 file 可被查找
-O file 你是 file 的所有者
-G file file 的组ID匹配你的ID
file1 -nt file2 file1比file2新 file1 -ot file2 file1比file2旧
|
本文转自 SoulMio 51CTO博客,原文链接:http://blog.51cto.com/bovin/1861004,如需转载请自行联系原作者