alias command is mainly used to define a new command (a shortcut name) for a single big command. It helps us to avoid repetitive long typing of commands.

  • The shortcut name can be used as a substitute for a single big command because shortcut name will have same functionality as if we write the big command.
  • It helps us to save a lot of time when we have to write big command frequently.
  • An alias doesn’t replace itself.

Syntax for alias command

  • There must be no spaces before or after the equals sign in the alias command.
alias [option] Name='value'

To display all defined alias use the command alias -p. We can also use alias to display all defined alias.

alias -p

alias -p command in linux

alias

Types of alias in Linux

We can create two types of alias in Linux

  1. Temporary alias
  2. Permanent alias

Creating Temporary alias

 

alias command in Linux with example

 

Creating Permanent alias

unalias the alias command

remove any specific alias

To delete any specific alias use commandunalias alias_name Don’t forget to replace alias_name with your alias name

unalias alias_name

remove all aliases

To delete all aliases  use the command unalias -a

unalias -a
A
adduser | addgroup | alias | anacron | apt | aptitude | arp | at | atq | atrm | awk
B
basename | banner | batch | bc | bg | bzip
C
cat | cal | cd | chgrp | chown | cksum | chmod | clear | cmp | comm | cp
D
date | dd | df | diff | dir | dmidecode | du
E
echo | eject | env | exit | expr
F
factor | find | free
G
grep | groups | gunzip | gzip
H
head | history | hostname | hostnamectl | htop | hwclock | hwinfo
I
id | ifconfig | ionice | iostat | ip | iptables | iw | iwlist
J
K
kill | kmod
L
last | less | ln | locate | login | lp | ls | lshw | lscpu | lsof | lsusb
M
man | mdsum | mkdir | more| mv
N
nano | nc | neofetch | netcat | netstat | nice | nmap | nproc
O
openssl
P
passwd | pidof | ping | pr | ps | pwd | pstree
Q
R
rdiff-backup | reboot | rename | rm | rmdir | rnmod
S
scp | shred | shutdown | sleep | sort | split | ssh | stat | su | sudo | sum
T
tac | tail | talk | tar | tee | time | tree | top | touch | tr
U
unalias | uname | uniq | unzip | uptime | users
V
vim | vi
W
w | wall | watch | wc | wget | whatis | whereis | which | who | whoami
X
xargs
Y
yes | youtube-dl
Z
zcmp | zdiff | zip | zz
Sharing is Caring
Scroll to Top