1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00
Files
til/unix/only-show-the-matches.md
2015-10-11 12:23:41 -05:00

330 B

Only Show The Matches

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