Bootstrap FreeKB - Linux Commands - alias (create commands)
Linux Commands - alias (create commands)

Updated:   |  Linux Commands articles

The alias command is used to create a command that will invoke another command. In this example, the user command will invoke the whoami command.

alias user=whoami

 

The user command now returns whoami.

~]$ user
john.doe

 

The unalis command can be used to remove the alias.

unalias user

 

The alias command will not survive when the user logs out or the system is restarted. To create a permanent alias, the alias would need to be created in /home/username/.bash_profile, like this.

alias user=whoami
export alias

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 9937bd in the box below so that we can be sure you are a human.