Created
December 31, 2020 09:53
-
-
Save sathishshan/2abfb6f8f2666331c00488d8b7a85285 to your computer and use it in GitHub Desktop.
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
grep -Porn <pattern> | |
P: Use Perl engine, grep can't run modern regexes otherwise | |
o: Only show the matching part, not the whole line | |
r: Search recursively | |
n: Print line number of matches | |
Bonus: use -Porh to exclude filenames from output i.e. only show matches. Great for piping. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment