# find、grep 排除指定目录
通过find
、grep
查找文件、内容的时候排查指定目录(如node_modules
)
# grep
grep -i --exclude-dir=node_modules -r "content" *
通过
grep
查找内容速度过慢时,推荐使用,参考文档 rgrep (opens new window)
# find
find . -name "package.json" ! -path "*node_modules*"
通过find
、grep
查找文件、内容的时候排查指定目录(如node_modules
)
grep -i --exclude-dir=node_modules -r "content" *
通过
grep
查找内容速度过慢时,推荐使用,参考文档 rgrep (opens new window)
find . -name "package.json" ! -path "*node_modules*"