How to Create A Shell Command Alias on Gnu/Linux

July 2, 2016 | By the+gnu+linux+evangelist.

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.

How to Create/Make a Command Alias on Linux - Featured
  1. Open a Shell Terminal emulator window
    (Press “Enter” to Execute Commands)

    Open Terminal

    In case first see: Terminal QuickStart Guide.

  2. Edit the Bash User’s Configuration File

    nano ~/.bashrc
  3. 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
  4. Enabling the New Alias.

    bash





QuickChic Theme • Powered by WordPress