-
-
Save hudolejev/81a05791f38cbacfd4de3ee3b44eb4f8 to your computer and use it in GitHub Desktop.
This file contains 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
$ echo 'afoobarfoobar' > a.txt | |
$ echo 'xyzzyfoobarfoobarfoo' > b.txt | |
# Print all occurrences in all files | |
$ grep -o foo a.txt b.txt | |
a.txt:foo | |
a.txt:foo | |
b.txt:foo | |
b.txt:foo | |
b.txt:foo | |
# Print number of occurrences per file | |
$ grep -o foo a.txt b.txt | sort | uniq -c | |
2 a.txt:foo | |
3 b.txt:foo | |
# Grep version | |
$ grep -V | |
grep (GNU grep) 2.25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment