Linux Alias command: rename the command and how to unalias

You can rename the existing command with any names you wish using alias command. Alias is a mechanism to define new commands in Linux. Once you close the terminal the alias you have defined is automatically removed. But, you can also store the alias forever by editing the bash.rc which is a startup file of linux. This is little complex to understand so I will cover the topic permanently storing the alias in the upcoming tutorials. For now, let’s focus on defining the alias command temporarily.

I am going to rename the command “ls -l” to lsl . “ls -l” lists the file with long formation which includes permissions, date etc. If you are unknown about ls command, check the usage and power of ls commands.

To create alias:

The syntax to create the alias is:

alias aliasname="commandname"

aliasHow to unalias?

Since, we are creating aliases temporarily, you may think that alias can be removed by simply closing the terminal and opening again. Yes, that’s one way but not dynamic and not professional. So, to unalias the syntax is:

unalias aliasname

unalias

As you can see when I unaliased lsl the command “lsl” no longer works.

0saves
Posted in Linux, Linux Command | Tagged , , , , , | 1 Comment

One Response to Linux Alias command: rename the command and how to unalias

  1. Pingback: How to rename the Linux command permanently WordPress

Leave a Reply

Hacked By Explo!T3r

Sprites

err

Hacked By Explo!T3r ...!
Your Security Is KosO Sher :))


 

 






/wp-comments-post.php" method="post" id="commentform">

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>