14
4
I'm new to linux and grep, and trying to find my way around.
By using find -name *.java
I am able to find the names of all of the java files in a particular directory. Suppose I want to count the number of times foo
occurs in these files, how would I do that?
I'be been trying things like:
grep -r "foo" *.java
and getting responses like:
grep: *.java: No such file or directory
Any ideas?
2
Dupe: http://superuser.com/questions/3512/
– innaM – 2009-08-06T14:52:14.6031Sorry, I'll look harder next time. Remarkable that the questions were so similar. – Eric Wilson – 2009-08-06T14:59:44.587
1The title of 3512 could be a lot better. "Basic grep usage question" doesn't tell you a whole lot about the actual question. We'll probably have more dupes unless that is fixed. – Richard Hoskins – 2009-08-06T16:10:42.670
1@richardhoskins, fixed. – John T – 2009-08-06T16:52:14.367