Making grep output easier to see

stand out steven depolo
Credit: flickr

If you'd like your search terms to be more visible when you use the grep command, you can use an alias like this. It will put the term that you're looking for in a different color so that you can spot it more easily on each line of text.

$ alias grep='grep --color=tty'
$ grep dark beerlist
Granny's very dark ale

This trick will also make it fairly obvious if you're only finding the string that you're looking for when it's part of a longer word.

This article is published as part of the IDG Contributor Network. Want to Join?

To express your thoughts on Computerworld content, visit Computerworld's Facebook page, LinkedIn page and Twitter stream.
Related:
Windows 10 annoyances and solutions
Shop Tech Products at Amazon
Notice to our Readers
We're now using social media to take your comments and feedback. Learn more about this here.