Linux战地日记——find命令

来源:互联网 发布:易建联卧推数据 编辑:程序博客网 时间:2024/05/22 12:40

find命令

find【选项】【参数】
find命令从指定的目录向下搜索符合条件的文件
注意:find命令不合理的使用可能占用大量的资源,所以使用的原则是尽量减少资源的占用。

选项:

-size 根据文件大小查找 大于 +小于 -等于 =(默认)
[coder@localhost test1]$ ls -ltotal 4-rw-rw-r--. 1 coder coder 571 Sep 20 19:06 f1-rw-rw-r--. 1 coder coder   0 Sep 20 08:16 f2-rw-rw-r--. 1 coder coder   0 Sep 20 08:16 f3-rw-rw-r--. 1 coder coder   0 Sep 20 08:16 f4-rw-rw-r--. 1 coder coder   0 Sep 20 08:16 f5drwxrwxr-x. 2 coder coder   6 Sep 20 18:47 ffdrwxrwxr-x. 2 coder coder   6 Sep 20 18:48 tt[coder@localhost test1]$ find -size +1./f1[coder@localhost test1]$ find -size -1./f2./f3./f4./f5

-type 查找指定的文件类型b 块设备文件c 字符设备文件d 目录文件p 管道文件  f 普通文件l 符号链接文件

find  /  -name  文件名  #从根目录查找文件

0 0
原创粉丝点击