I often run grep commands to find things in my code, but the problem with web projects is that there will often be compressed JavaScript and CSS files which create one huge line of text, so that if a match is found, the whole terminal window is filled for more then a 1000 lines, making it extremely impractical to find what I'm looking for.
So is there a way to avoid files that have say single lines of text over 200 characters?
Best Answer
With GNU grep and xargs:
Alternatively, you could cut the output of grep:
or tell your terminal not to wrap text if it supports it:
or use
less -S