Skip to content

Instantly share code, notes, and snippets.

@MohamedElashri
Last active May 26, 2021 05:50
Show Gist options
  • Save MohamedElashri/e72dbc60b18785fe45999cd9c94d4d67 to your computer and use it in GitHub Desktop.
Save MohamedElashri/e72dbc60b18785fe45999cd9c94d4d67 to your computer and use it in GitHub Desktop.
Create alias to show diff in colors #terminal

grc works great for this. It is installable with brew and colorizes a number of terminal commands out of the box, diff being one of them. To build on the approved answer: grc works great for this. It is installable with brew and colorizes a number of terminal commands out of the box, diff being one of them.

  1. First install grc via homebrew

brew install grc

  1. Then you need to set up your aliases, the brew caveat provides a solution. Simply add the following line to your ./bashrc or ./bash_profile

source "`brew --prefix`/etc/grc.bashrc"

  1. This will create the following aliases
alias colourify="$GRC -es --colour=auto"
alias configure='colourify ./configure'
alias diff='colourify diff'
alias make='colourify make'
alias gcc='colourify gcc'
alias g++='colourify g++'
alias as='colourify as'
alias gas='colourify gas'
alias ld='colourify ld'
alias netstat='colourify netstat'
alias ping='colourify ping'
alias traceroute='colourify /usr/sbin/traceroute'
alias head='colourify head'
alias tail='colourify tail'
alias dig='colourify dig'
alias mount='colourify mount'
alias ps='colourify ps'
alias mtr='colourify mtr'
alias df='colourify df'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment