If you find yourself typing the exact same long Linux commands, you can save a lot of time typing or trying to remember what the command even is, by using aliases. An alias is simply a custom shortcut (a nickname) for a longer command. For example, instead of typing a long directory path every time, you can just type a two-letter shortcut.

In a terminal:

  1. alias
  2. With an editor: Bash: ~/.bashrc Zsh: ~/.zshrc ie vim ~/.bashrc
  3. At the bottom of the file
# my aliases
alias ALIASNAME="YOURCOMMAND"
  1. Save and exit, to make the changes take effect immediately without rebooting, source ~/.bashrc