版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
注:查找目录: find (查找范围) -name ‘查找关键字’ -type d
查找文件: find (查找范围) -name ‘查找关键字’ -print(type f)
例:
在当前工作目录中查找名称为itcast的所有文件: find -name ‘itcast.*’ -type f
查找/ home目录下的所有文件名称: find /home -name ‘*’ -type f
在/目录下查找名称为itcast的所有目录: find / -name ‘itcast’ -type d
在/目录下查找名称为itcast的所有文件: find / -name ‘itcast’ -print(type f)
在/目录下查找所有txt文件: find / -name ‘*.txt’ -print(type f)
查以大写字母开头的文件 : find -name ‘[A-Z]*’ -print(type f)