Making a Linux Command Alias
Hi! This Simple Guide shows you Step-by-step How to Create and Enable a Shell Command Line User’s Alias on GNU/Linux Systems.
An Alias is meant to Quickly Executing a Command by simply Calling a synthetic Label or Name.
So every time you “call” the Alias Name on a Terminal window your Action will Correspond to the Sequence of Commands Linked to the Label.
This an essential Zen guide that simply seeks to bring each user to the target in the easiest and quickest way.
-
Open a Shell Terminal emulator window
(Press “Enter” to Execute Commands)In case first see: Terminal QuickStart Guide.
-
Edit the Bash User’s Configuration File
nano ~/.bashrc
-
Append the Alias Command.
alias MYALIASNAME="MYALIASCOM"
Without Spaces between the “=” like here above…
Example:alias htdocs="cd /opt/local/apache2/htdocs"
Then Executing:
htdocs
Will Correspond to:
cd /opt/local/apache2/htdocs
-
Enabling the New Alias.
bash