find命令
-
使用方法
find (选项) (参数)
实例
-
列出当前目录集子目录下的所有文件和文件夹
find .
-
在home目录下查找以.txt结尾的文件名
find /home -name "*.txt"
-
同上 但是忽略大小写
find /home -iname "*.txt"
-
匹配文件路径或者文件
find /usr -path "*local"
可以在查找路径的时候使用 -
否定参数 找出/home下不是以.txt结尾的文件
find /home ! -name "*.txt"
-
根据文件类型搜索
find . -type 类型参数
f:普通文件
d:目录 -
指定查询的执行深度
find -maxdepth 1