1. Name

alias - create names or abbreviations for commands

2. Examples

Alias can be used to correct our typos on shell command line. For example we can create sl command to simulate ls command:

$ alias sl=ls 

correct typos on bash command line with alias
Another way how to use alias is to create new customized commands:

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

create new customized bash commands with alias
Alias can also be used for abbreviations:

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

create abbreviations to bash commands with alias
NOTE: to unalias your commands use unalias command.

$ unalias ls 

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

alias ls="ls --file-type" 

Free Linux eBooks

Go to top