← Back to all TILs

Only Show The Matches

unix Written October 11, 2015

Tools like grep, ack, and ag make it easy to search for lines in a file that contain certain text and patterns. They all come with the -o flag which tells them to only show the part that matches.

This is particularly powerful when used with regex and piped into other programs.

h/t Dillon Hafer

Other posts like this