DEV Community

Discussion on: Seeing Context with `grep`

Collapse
 
rpalo profile image
Ryan Palo

Does cat do search highlighting?

Collapse
 
jmcp profile image
James McPherson

No, because that's not its job. If you want search highlighting use a colourised grep. If you just want to see the whole file, use cat. Do one thing, do it well.

Thread Thread
 
rpalo profile image
Ryan Palo

Yeah cool, just checking. Thanks for clarifying. This post was mostly about different ways to see more of the file as you searched for specific things, but you are right that if all you want to do is see the contents of the file, cat is the best option for short files. I appreciate the addition!

Collapse
 
dfunkydog profile image
dfunkydog • Edited

No, but you can alias cat to bat