linux各种查找
查找包含字符串的文件:find / -name "*.php" | xargs grep "getQueue" ;
查找包含特定字符串的文件名:find / -type f | grep "Model"
查找包含特定字符串的目录:find / -type d | grep "Model"
查找 /projects/logs/目录下包含xytest内容的文件:find /projects/logs/ |xargs grep -l 'xytest'
which : 告诉我们当输入某个命令执行时,SHELL到底调用了哪个版本的命令。which指令会在环境变量$PATH设置的目录里查找符合条件的文件
whereis :whereis指令会在特定目录中查找符合条件的文件。这些文件的烈性应属于原始代码,二进制文件,或是帮助文件
查找目录下面是否包含特定的文件类型(可以同时查找多个),如下:
sudo find ./ -type f \( -name "*.rar" -o -name "*.zip" -o -name "*.xls" -o -name "*.xlsx" \)
posted on 2013-03-26 12:20 andydaopeng 阅读(159) 评论(0) 编辑 收藏 举报