Created
February 24, 2015 10:04
-
-
Save angusdev/c519abef5adc052b01f4 to your computer and use it in GitHub Desktop.
# Find the number of occurrence of each line of file in all files from current directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Find the number of occurrence of each line in /path/to/file in all files from current directory | |
| # sample ouput | |
| # alice 0 | |
| # bob 3 | |
| # chris 14 | |
| cat /path/to/file | while read -r line ; do | |
| echo $line `grep -src $line * | grep -v ':0$' | wc -l` | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment