Co-Authored By:
Asked by: Ruggero Zapirain
technology and computing operating systemsHow do I permanently set an alias in Linux?
Steps to Setting Up Aliases in the bash-shell
- Open your . bashrc.
- Go to the end of the file. In vim, you can accomplish thisjustby hitting “G” (please note that it iscapital).
- Add the alias. A simple way to chain commandsinLinux is to use the && operator.
- Write and close the file.
- Install the .
Similarly one may ask, how do I permanently create alias in Ubuntu?
To create an alias in Ubuntu 16 via the commandline, dothefollowing:
- Open .bashrc. sudo nano -Bu ~/.bashrc.
- Scroll down to the bottom of the file and add thedesiredaliases. #Custom Aliases.
- Save and close the file (Ctrl + O, Enter, then Ctrl + X)
- Test your alias.
Thereof, how do you set up an alias?
To create an alias in bash that is set every time youstarta shell:
- Open your ~/.bash_profile file.
- Add a line with the alias—for example, aliaslf='ls-F'
- Save the file.
- Quit the editor. The new alias will be set for the nextshellyou start.
- Open a new Terminal window to check that the alias isset:alias.
Steps to Setting Up Aliases in the bash-shell
- Open your .bashrc. Your .bashrc file is located in youruserdirectory.
- Go to the end of the file. In vim, you can accomplish thisjustby hitting “G” (please note that it iscapital).
- Add the alias.
- Write and close the file.
- Install the .bashrc.