How to make Linux bash alias persistent

linux
unix
bash
bashrc

#1

I set up bash shell alias alias grep=‘grep --color’ but after rebooting my box, it goes away. I need to redefine the alias again. How do I make bash shell alias persistent?


#2

Add them to ~/.bashrc file. For example:

vi ~/.bashrc

OR

vi $HOME/.bashrc

Append aliaes:

alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias vi='vim'

Save and close the file. See


And: