Reputation: 32321
I am using Ubuntu 12 . I am trying to search for the word "SymbolSetThree" in my Ubuntu Machine home directory .
For this i used
grep "SymbolSetThree" /home
It simply displayed as grep: /home: Is a directory
Please let me know how to search for a particular word in all the files in Linux ??
This is what i tried
sai@sai-Aspire-4720Z:/$ grep "SymbolSetThree" /home
grep: /home: Is a directory
Upvotes: 5
Views: 40585
Reputation: 3031
For this kind of tasks I really like ack-grep, is programmer oriented (only source files, .py .rb .c .sh) but with -a it looks for all kind of files.
ack-grep -a "SymbolSetThree"
Upvotes: 2
Reputation: 184965
You are close, you just need the -r
switch to have your command working properly.
grep -r "SymbolSetThree" /home
will do the trick.
Upvotes: 6
Reputation: 500167
Use `find:
find /home -type f | xargs grep SymbolSetThree
The same result can be achieved by using the -exec
argument to find
(instead of xargs
).
Upvotes: 3