find 路径 [参数] 文件名
-name :文件名称符合 name 的文件
-iname :文件名称符合 name 的文件,iname 会忽略大小写
-type:找出符合文件类型的文件
-pid:找出对应的进程id的文件
-size [+ -]:按照指定大小搜索文件(c为字节、k为KB单位、M为MB单位、G为GB单位)
-perm [/|-]mode:根据权限查找(mode:精确权限匹配;/mode:任何一类用户(u,g,o)的权限中的任何一位(r,w,x)符合条件即满足; -mode:每一类用户(u,g,o)的权限中的每一位(r,w,x)同时符合条件即满足。)
-uid :按照用户 ID 査找所有者是指定 ID 的文件
-gid :按照用户组 ID 査找所属组是指定 ID 的文件
-user :按照用户名査找所有者是指定用户的文件
-group :按照组名査找所属组是指定用户组的文件
文件类型:
f/- 普通文件 保存数据
d 目录文件 存放文件
l 符号链接文件 指向其他文件
b 块设备 文件 访问设备
c 字符设备文件 访问设备
p 管道文件 进程间通信
s 套接字文件 进程间通信
find . -iname "*.jpg"
find . -type d
find . -type f
find . -type f -perm 777
find . -xdev ( -perm -4000 ) -type f -print0 | xargs -0 ls -l
find ./path/ -name '*.txt' -exec rm '{}' \;
find ./path/ -name '*.txt' | xargs grep 'string'
find . -size +5M -type f -print0 | xargs -0 ls -Ssh | sort -z
find . -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ":" $5 }'
find . -type f -mtime +7d -ls
find . -type l –user=username -ls
find . -type d -empty -exec rmdir {} \;
find . -maxdepth 2 -name build -type d
find . ! -iwholename '.git' -type f
find . -type f -samefile MY_FILE_HERE 2>/dev/null
find . -type f -exec chmod 644 {} \;
find . -iname '*.txt' -exec vim {} +
find . -iname "*.jpg"
find . -type d
find . -type f
find . -type f -perm 777
find . -xdev ( -perm -4000 ) -type f -print0 | xargs -0 ls -l
find ./path/ -name '*.txt' -exec rm '{}' \;
find ./path/ -name '*.txt' | xargs grep 'string'
find . -size +5M -type f -print0 | xargs -0 ls -Ssh | sort -z
find . -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
find . -type f -mtime +7d -ls
find . -type l --user=username -ls
find . -type d -empty -exec rmdir {} \;
find . -maxdepth 2 -name build -type d
find . ! -iwholename '*.git*' -type f
find . -type f -samefile MY_FILE_HERE 2>/dev/null
find . -type f -exec chmod 644 {} \;
find . -iname '*.txt' -exec vim {} +
腾图小抄 SCWY.net v0.03 小抄561条 自2022-01-02访问368381次