Shell_Find
find
1.基本格式(绿色的部分为固定参数)
(1)find 路径 -name‘*.txt’;表示查找以.txt结尾的文件
&example: find . -name '*.txt' /*表示查找当前目录下的以.txt结尾的文件*/
(2)find 路径 -name‘[a-z]*’ ; 表示查找以字母a-z开头的文件
example: find . -name '[a-z]*'
(3) find 路径 -name ‘host*’ ; 查找以字母“host”开头的文件
(4)find 路径 -perm775 ; 查找权限是 775 的文件
(5)find 路径 -userroot ; 查找文件用户是root 的文件
(6)find 路径 -mtime +n(-n) ;查找 当前目录下n天以前(n天以内的)
(7)find 路径 -type f ; 查找当前目录下类型是file的文件(d:目录文件,l : 链接文件)
(8)find 路径 -size +1000000c ; 查找当前目录下,文件大小超过1M的文件,“-”以内的,c代表字节。