Skip to content

Instantly share code, notes, and snippets.

@Fartomy
Last active February 19, 2023 19:15
Show Gist options
  • Save Fartomy/bae804740cab3a9e76d48912f1c23e43 to your computer and use it in GitHub Desktop.
Save Fartomy/bae804740cab3a9e76d48912f1c23e43 to your computer and use it in GitHub Desktop.
Beauty of Alias

✨ Beauty of Alias

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.

Usage

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.

For Example

alias upd="sudo apt update; sudo apt upgrade; sudo apt autoremove; sudo apt autoclean; sudo apt clean"

⚠️ Notice

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment