背景介绍:
在使用linux查找文件时,有些目录不需要查找,在查到这些目录时会打印很多无用提示信息,如:
方法:
使用-path -prune参数达到屏蔽这些目录的效果
排除一个:find ./ -path /proc -prune -o -name target_file -type d -print
排除多个:find ./ (-path /proc -o -path ./cs ...) -prune -o -name target_file -type d -print
其中-path 参数必须在查找路径后边才会生效 -prune -o 而单词prune为修剪的意思,后边还有参数-o,是'或者'的意思
如果/proc目录存在则