1. Tech

Your suggestion is on its way!

An email with a link to:

http://linux.about.com/library/glossary/bldef_alias.htm

was emailed to:

Thanks for sharing About.com with others!

Alias Command
<Back to Last Page>     <Full Glossary>

 Related Terms
• Shell Command
 
 

Definition: alias is a built-in shell command in Linux / Unix operating systems. It can save you a lot of typing by assigning a name to long commands. For example, if you need to repeatedly copy files from one directory to another using the command

cp /home/jones/data1/* /usr/local/share/latest/.

you can replace this long command line with a short easy to remember name like "moveit" using the alias command as follows:

alias moveit="cp /home/jones/data1/* /usr/local/share/latest/."

Then you can just type "moveit" at the command prompt and it will do the same copy operation.

If you change your mind and want to assign a different command to the alias, you do it same way-the previous definition will be overwritten.

If you don't want anything assigned to the alias anymore you can un-set it using "unalias":

unalias moveit

If you want to check all the alias definitions currently active, simply type alias without any arguments:

alias

An alias definition is valid only in the current shell execution environment and the execution environments of its subshells.

Related Resources:

Command Library
Linux / Unix commands are introducted one by one.


<Back to Last Page>     <Full Glossary>
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

©2014 About.com. All rights reserved.