-
Notifications
You must be signed in to change notification settings - Fork 13
tools_find
Zhang Jc edited this page Aug 1, 2017
·
6 revisions
- 查找某个目录[dir]下所有文件的某些内容[content]
find [dir] -type f|xargs grep [content]
find [dir] -name [pattern]
例如:
- 查找某(几)后缀的文件
find [dir] -name "*.c" [-o -name "*.py"] [-o -name "*.h"] ...
这里的-o参数还可以写成-or, 就是或的意思。
- 查找名字包含某字符串的文件
find [dir] -name "*foobar*"
find / -amin -100 #查找在系统中最后100分钟访问的文件(access time)
find / -size +100k #查找出大于100k的文件(c:字节,w:双字,k:KB,M:MB,G:GB)
find / -size -100k #查找出小于100k的文件
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。
Wiki: wiki.jcix.top ~聚沙成塔~ Blog: blog.jcix.top