alias - create names or abbreviations for commands


Alias can be used to correct your typos on shell command line. For example, the most common typo is typing sl instead of ls. The following alias command will make sl and ls interchangeable.
$ alias sl=ls
correct typos on bash command line with alias
Another useful way on how to use alias command is the ability to create a new customized commands for most used commands chains. For example:

$ alias estcon="netstat -ant | grep ESTABLISHED" 

create new customized bash commands with alias
yet, another example of alias command usage

$ alias ls="ls --file-type" 

create abbreviations to bash commands with alias

NOTE: to unalias your already alias defined commands use unalias.

$ unalias ls 

Please note, that all alias definitions are temporary and accessible within a current terminal session only. To make an alias permanent, you need to edit your ~/.bashrc file. For example to create a new permanent alias for ls command insert a following line into your ~/.bashrc file:

alias ls="ls --file-type" 
Please refer all article related questions to:

You may also be interested in: