Linux Commands - alias (create commands)

by
Jeremy Canfield |
Updated: October 28 2023
| 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