Member
- Joined
- Apr 24, 2019
- Messages
- 45
- Thread Author
- #1
In this post i will explain these as follows :
what is alias
how to create alias
what is an alias?
It is a simple way to create new commands by wrapping existing commands. They are best if you have a very long command and you are too lazy to type it again and again.
how to create an alias?
alias has a syntax like this :
alias name='command'
for example if i have a command to start lxde "DISPLAY=:1 startlxde&" and this is too long to type again and again so i will create an alias with name runlxde to automate this like this :
alias runlxde='DISPLAY=:1 startlxde&'
then the next time if i want to start lxde then i will simply type the command runlxde and hit enter and then it will execute my command.
how to remove a alias?
to remove an alias simply use this command :
unalias alias_name
bonus
sometimes it happens that you may want to bypass an alias temporarily without unaliasing it, for that you can use this trick :
use command builtin before your command like this :
command ls
use \ anywhere between the command like this :
\ls or l\s
alright guys this is it. thankyou for reading bye.
what is alias
how to create alias
what is an alias?
It is a simple way to create new commands by wrapping existing commands. They are best if you have a very long command and you are too lazy to type it again and again.
how to create an alias?
alias has a syntax like this :
alias name='command'
for example if i have a command to start lxde "DISPLAY=:1 startlxde&" and this is too long to type again and again so i will create an alias with name runlxde to automate this like this :
alias runlxde='DISPLAY=:1 startlxde&'
then the next time if i want to start lxde then i will simply type the command runlxde and hit enter and then it will execute my command.
how to remove a alias?
to remove an alias simply use this command :
unalias alias_name
bonus
sometimes it happens that you may want to bypass an alias temporarily without unaliasing it, for that you can use this trick :
use command builtin before your command like this :
command ls
use \ anywhere between the command like this :
\ls or l\s
alright guys this is it. thankyou for reading bye.