Friday, May 22, 2015

How to set alias in aix?

How to set alias in aix?


I frequently working on vio server, everytime i wanna execute the vio command, i need to go to vio prompt and then execute the commands, to make my work easier, I am going to put the alias for the /usr/ios/cli/ioscli command.

By using aliases, you can save a lot of time when doing tasks you do frequently.

Please find the syntax for creating an alias below:

alias Name=String

Note: The Name parameter specifies the name of the alias, and the String parameter specifies a string of characters. If String contains blank spaces, enclose it in quotation marks.


To create an alias for the command /usr/ios/cli/ioscli at the prompt, type the following:

alias viocmd=/usr/ios/cli/ioscli

 In this example, whenever I enter the command viocmd, the actual command performed is =/usr/ios/cli/ioscli


For example: On vio server Instead of executing #/usr/ios/cli/ioscli lsmap -all in aix prompt, i can execute with the alias like below.

                   #viocmd lsmap -all


Example 2:

To create an alias for the command rm -i at the prompt, type below
alias rm="/usr/bin/rm -i"

To display all the aliases we have, type the following:
alias

The output is like below

viocmd=/usr/ios/cli/ioscli
rm="/usr/bin/rm -i"


If you happy with above topic, Kindly rate your reactions/comments below