daysme

find / -type f ! -path \'*/node_modules/*\' -name \'*.js\' -exec grep -l \'v10/exlibs\' {} \;

查找文本

参考: https://stackoverflow.com/questions/16956810/how-do-i-find-all-files-containing-specific-text-on-linux

# 在 md 和 js 文件名查询 python, 排除一些目录
grep -s --exclude-dir={*\.*,node_modules,dist} --include=\*.{md,js} -rnwl \'/Users/xw/\' -e "python" -H --color
# man grep
# -r 或者-R是递归,
# -n 是行号
# -H 不显示不匹配的文件名
# -w 代表整个单词的匹配
# -l 代表“显示文件名,而不是结果”
# -s 不显示 `No such file or directory` 报错
# i 代表忽略大小写

分类:

技术点:

相关文章:

  • 2021-11-30
  • 2021-11-30
  • 2021-12-01
  • 2021-11-30
  • 2021-12-05
  • 2021-11-28
  • 2021-09-30
猜你喜欢
  • 2021-10-09
  • 2021-11-13
  • 2021-11-13
  • 2021-12-01
  • 2021-11-18
  • 2021-11-18
相关资源
相似解决方案