Creating Aliases Using Bash
Last Updated by Code Sport. Filed under linuxHow to Create Command Line Aliases in Linux This nifty tip was…
This nifty tip was provided by Maco on StackEchange’s AskUbuntu forum:
$ sudo nano ~/.bash_aliases
Now, add the following line to the file:
alias grep='grep -n --color=always'
There is an include directive in ~/.bashrc
that loads ~/.bash_aliases
if it exists
Shell settings go into ~/.bashrc
. They impact all terminal users on your server. On the other hand, session settings only impact the user who is logged. These are also called “environment variables” definitions and go into ~/.profile
(c.f. http://unix.stackexchange.com/a/69267)