Linux alias


alias [-p] [name[=value] ... ] * -p: prints all current aliases in Linux * name: the name of the shortcut * value: the command that the shortcut references

Creating Aliases in Linux


Just use the alias command in your terminal. It will last until the end of the current terminal session.

alias c=clear

You may also include additional command options in the alias: alias rmall='rm -r'


All you need to do to make the aliases permanent, is to add them to you bash configuration file.

Example: Bash

To add your custom aliases, first open the configuration file in a text editor such as nano: sudo nano ~/.bashrc

A fitting place for custom aliases is under the section of default system aliases.

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Custom aliases
alias c='clear'
alias rmall='rm -r'

Save the changes with Ctrl+S or Ctrl+O and Enter, then exit with Ctrl+X.

To make the changes take effect in the current terminal session simply write source ~/.bashrc.