setting alias in linux terminal code example
Example 1: set alias in ubuntu
Ctrl+Alt+T
gedit ~/.bashrc_alias
alias name_of_alias="command you want to execute"
alias name_of_another_alias="another command you want to execute"
Ctrl+S
source ~/.bashrc_alias
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'