Alias Command - Linux

Alias  is very useful command in Linux. On our daily routine, we tend to use more common lengthy commands..

like traversing through some path , copying file from the same directory etc. Now that we can define a name to the usual lengthy commands.

First of all just trigger this command on any path and try to know that our system is been configured with some alias name for many tricky lengthy commands.

karthikk.desktop% alias 

Now, lets have a look at how to define them.

we have some thing called temporary and permanent alias name. lets discuss one by one.

To define a  temporary alias name ( i.e the alias name will exist only until that particular terminal is closed).

Add the alias assignment in the . zshrc/.bash_profile file.

Syntax :  

karthikk.desktop% alias <name of your choice>='<any linux  command>'

Example :

karthikk.desktop% alias ec='eclipse.exe -clean'​

To Define a permanent alias name (i.e the alias name will exist even if the system is rebooted)

In order set them, you have define your alias name in the .zhrc/.bash_profile file and source the same.

karthikk.desktop% source $HOME/.bash_profile

NOTE: . zshrc/.bash_profile generally reside in $HOME

Print   Email