code_junkie

count all occurrences of string in lots of files with grep

Nov 13th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. grep -c string *
  2.  
  3. ...
  4. file1:1
  5. file2:0
  6. file3:0
  7. ...
  8.  
  9. grep -c string * | grep -v :0
  10.  
  11. ...
  12. file4:5
  13. file5:1
  14. file6:2
  15. ...
  16.  
  17. cat * | grep -c string
  18.  
  19. grep -o string * | wc -l
  20.  
  21. cat * | grep -c string
  22.  
  23. grep string * | wc -l
Add Comment
Please, Sign In to add comment