Linux/Unix – Command Alias

Command Alias

Use alias to assign an alias, a name that represents another command or commands. Aliases are useful for creating short command names for lengthy and frequently used commands.

To make an alias of bye for the exit command, type:

$ alias bye=”exit”


This command makes `bye’ an alias for `exit’ in the current shell, so typing bye would then run exit. You can also include options and arguments in an alias.

To make an alias of `ap’ for the command apropos shell bash shells, type:

$ alias ap=”apropos shell bash shells”

 

This command makes `ap’ an alias for `apropos shell bash shells’ in the current shell, so typing ap would run apropos shell bash shells.

Advertisements

About msotela

This blog is for anyone who wants to access the power of a Linux system as a systems administrator or user. You may be a Linux enthusiast, a Linux professional, or possibly a computer professional who is increasingly finding the Windows systems in your data center supplanted by Linux boxes.

Posted on March 15, 2009, in Unix/Linux. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: