Typing out long, complex commands in the Linux terminal repeatedly is tedious. Creating an alias allows you to assign a short, custom keyword to trigger the long command instantly.
How to Create an Alias
- Open your terminal.
- Open your bash profile by typing:
nano ~/.bashrc - Scroll to the bottom of the file and add your alias. For example:
alias update='sudo apt update && sudo apt upgrade -y' - Save the file (Ctrl+O, Enter, Ctrl+X) and reload your profile:
source ~/.bashrc.