User Tools

Site Tools


number_of_matches_per_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
number_of_matches_per_file [2021/10/31 21:17] – [How it works] adminnumber_of_matches_per_file [2021/11/04 14:59] (current) – [Solution using grep and awk] admin
Line 71: Line 71:
 ===== Solution using grep and awk ===== ===== Solution using grep and awk =====
 <code> <code>
-grep -ro "came across" * | awk -F':' '{freq[$1]++} END{for (file in freq) print file ":" freq[file]}'+grep -ro foo * | awk -F':' '{freq[$1]++} END{for (file in freq) print file ":" freq[file]}'
 </code> </code>
  
number_of_matches_per_file.1635715037.txt.gz · Last modified: 2021/10/31 21:17 by admin