Alias


From Linuxconfig.org

Jump to: navigation, search

Name

alias - create names or abbreviations for commands

Examples

Can be used to correct our typos on bash command line. Create sl command to list directory:

$ alias sl=ls
Image:alias01.gif

create new customized commands:

$ alias estcon="netstat -ant | grep ESTABLISHED"
Image:alias02.gif

or abbreviations:

$ alias ls="ls --file-type"
Image:alias03.gif

NOTE: to unalias your commands you can use unalias command.

$ unalias ls

However creation of aliases with alias command is temporary just for current terminal session. To make alias permanent consult ~/.bashrc file. To make changes pernament edit your ~/.bashrc file and add line similar to this:

alias ls="ls --file-type"
Personal tools
Linux Commands