Linux:搜索所有文件中的特定单词
我使用的是Ubuntu 12。 我试图在我的Ubuntu机器主目录中搜索“SymbolSetThree”这个词。
对于这个我使用
 grep "SymbolSetThree" /home
它只是显示为grep:/ home:是一个目录
请让我知道如何在Linux中的所有文件中搜索特定单词?
这是我的尝试
sai@sai-Aspire-4720Z:/$  grep "SymbolSetThree" /home
grep: /home: Is a directory
  你很近,你只需要-r开关来让你的命令正常工作。 
 grep -r "SymbolSetThree" /home
会做的伎俩。
使用`find:
find /home -type f | xargs grep SymbolSetThree
  使用-exec参数来find (而不是xargs )可以获得相同的结果。 
对于这种类型的任务,我真的很喜欢ack-grep,它是面向程序员的(只有源文件,.py .rb .c .sh),但使用-a它会查找所有类型的文件。
ack-grep -a "SymbolSetThree"
上一篇: Linux : Search for a particular word in all the files
下一篇: Heroku app load failure "not present in the asset pipeline"
