Replace grep command with grep -n --colour?

is there anything similar for rgrep auto color?


add this line to your .bashrc in your home directory

alias rgrep="grep -n --colour"

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


To this version:

args="${args:--His} --color=auto"
  • This appears to be a comment on another answer rahter than a complete answer. – Elder Geek Dec 17 '14 at 16:47
  • Hi Elder, Doing like this permit to always use rgrep with color... Wasn't it the original ask? – mnono Dec 23 '14 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 '14 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 '15 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.