Alias is a shortcut that references a command. Alias will make it easy if you have a long command line and are always worried about typing it.
alias [option] [name]='[value]'
alias
- Invokes the alias command.[option]
- Allows the command to list all current aliases.[name]
- Defines the new shortcut that references a command. A name is a user-defined string, excluding special characters and 'alias' and 'unalias', which cannot be used as names.[value]
- Specifies the command the alias references. Commands can also include options, arguments, and variables. A value can also be a path to a script you want to execute.
alias upd="sudo apt update; sudo apt upgrade; sudo apt autoremove; sudo apt autoclean; sudo apt clean"
When you use alias command on any terminal session it work. But when you close your terminal session, your aliases probably lost. Therefore, we should add in any terminal .config file. Like a .bashrc or .zshrc. Should add our aliases in these config files.