find -exec
# -exec end with ;but must use \;keep jianrong
# {} means the result of find
find /etc/ -name sources.list -exec ls -alh {} \;
.=`pwd` means from current directory
-name
find `pwd` -name *.c
-perm 根据权限查找
find . -perm 755 -print
查找可执行文件
-prune
-user
find . -user root
-group
find . -user root
-mtime
find . -mtime -5
查找modifytime 5天前的文件
-type
b 块设备文件
d 目录
c 字符文件设备
p 管道文件
l 符号链接
f 普通文件
find /etc -type d
find . ! -type d
-size n:[c] 查找文件长度为n块的文件,带有c时表示文件长度以字节计。
find . -size +1000000c –print 在当前目录下查找文件长度大于1 M字节的文件
find /home/apache -size 100c –print 在/home/apache目录下查找文件长度恰好为100字节的文件
find . -size +10 –print 在当前目录下查找长度超过10块的文件(一块等于512字节