-type
是find命令的一个参数:
-type:查找某一类型文档
b:块设备文档
d:目录
c:字符设备文档
p:管道文档
l:符号链接文档
f:普通文档
sudo find /etc -size +1M -exec echo {} ;
#在/etc目录下找文件大小在1M以上的文件并且显示,文件用换行符隔开。
sudo find /etc -size +1M | xargs echo
#达到-exec相同的功能但是用空格分开寻找到的文件。
#-exec后面的{} ;是不能少的。
find 紧跟的是指定开始寻找的绝对路径,我取当前路径。
find ./ -user 用户名
#find后面接的是开始寻找路径名,它会在这个路径下递归寻找。
#-user 指定用户名
find ./ -not -user 用户名
find ./ -not -name 文件名
find ./ -not -type 类型(一般文件f,目录d,字符文件c)
#寻找不匹配的文件。
find ./ -user 用户名 -o -type f
#寻找当前目录下用户你指定用户文件或者(-o)一般文件。
find ./ -size +1M -o -type d
#寻找当前目录下文件大于1M的文件或者是目录。
find ./ -size -1M -a -type f
#寻找当前目录下文件小于1M并且文件类型是一般文件的文件。
-o 是或者的意思
-a 是而且的意思
-not 是相反的意思