Tuesday, August 25, 2009

Highlight your grep results

Used grep command before ?
grep is a very good command that allows you to grep text :)
It allows you to search the contents of a file/group of files for a string (regular expression)

of course it is great, but the output may be somewhat confusing !!!!

so, try this:
alias grep='grep --color=always'
then try to use grep, you will see the output contains the string you search for is highlighted.

try to put this command in your .bashrc file in order not to re-alias it each time, like that :
echo "alias grep='grep --color=always'" >> ~/.bashrc

No comments: