0

Replace grep command with grep -n --colour?

is there anything similar for rgrep auto color?

2 Answers 2

2

add this line to your .bashrc in your home directory

alias rgrep="grep -n --colour"
0

Just execute the following lines and modify one line as describe bellow

mkdir -p ~/bin
cd ~/bin
wget http://sdjf.esmartdesign.com/files/rgrep
chmod +x rgrep

Edit it and modify the line

args=${args:--His}

To this version:

args="${args:--His} --color=auto"
4
  • This appears to be a comment on another answer rahter than a complete answer.
    – Elder Geek
    Dec 17, 2014 at 16:47
  • Hi Elder, Doing like this permit to always use rgrep with color... Wasn't it the original ask?
    – mnono
    Dec 23, 2014 at 16:34
  • Actually the original question as I understood it appeared to be looking for something similar to rgrep auto color. Perhaps I misunderstood.
    – Elder Geek
    Dec 24, 2014 at 1:08
  • Thanks for the modifications, it's clearest. (I didn't knew the p option on mkdir.) To complete, if not working (command not found), add ``` export PATH=$PATH:~/bin ``` into one of the autoloaded configuration file (~/.bashrc or ~/.zshrc or else depending of your distribution)
    – mnono
    Jan 2, 2015 at 10:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .