refresh bashrc aliases code example
Example 1: restart bashrc
. ~/.bashrc
Example 2: bash how to set up aliases
1. Open the .bashrc file with your favorite shell text editor. E.g.
type "vi ~/.bashrc"
2. Define an alias on a new line using this basic syntax:
alias abbreviated_command='original -long -command'
E.g.: alias ls='ls --color -lhAFG'
3. Save and exit the .bashrc file (e.g. type ":q" and Enter in vi/vim)
4. Source the .bashrc file to apply/activate the alias. E.g.
type "source ~/.bashrc"
alias bashrc='vi ~/.bashrc'
alias sourcebash='source ~/.bashrc'
Example 3: load new bashrc alias terminal
source ~/.bashrc