Skip to content

Instantly share code, notes, and snippets.

@pwrliang
Created April 3, 2019 08:23
Show Gist options
  • Save pwrliang/931ec5e664fa751cb03e58166223ecfd to your computer and use it in GitHub Desktop.
Save pwrliang/931ec5e664fa751cb03e58166223ecfd to your computer and use it in GitHub Desktop.
常用sh命令总结
1. 从input.txt读取每一行,搜索当前目录下以py结尾的文件,看文件是否包含input.txt中的关键字
for i in `cat ~/input.txt`; do find . -type f -name '*.py' | xargs grep -ni -e $i | grep -v "要排除的关键字" | sort; done > ~/scan.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment