I'm using a command which I don't know where the information is stored.
alias nup='ps ax | grep "nginx"'
Where is this alias saved?
They are typically placed in the ~/. bashrc (bash) or ~/. tcshrc (tcsh) startup files so that they are available to interactive subshells.
To see a list of aliases set up on your linux box, just type alias at the prompt. You can see there are a few already set up on a default Redhat 9 installation. To remove an alias, use the unalias command.
bash aliases you create by running the alias command are not stored anywhere, they are gone as soon as you exit the shell. To make persistant aliases which will be available in all newly executed bash shells add the definition to ~/. bashrc .
It depends upon your environment and configurations. For bash, I would generally put it in a .bashrc file that in a home directory.
In ubuntu alias get stored in the .bashrc
file.
If you are typing alias update_linux='sudo apt-get update'
in the terminal, then it will create an alias temporarily. It works until you close your terminal.
To add an alias permanently you can edit ~/.bashrc
and add the alias to it:
gedit ~/.bashrc
and add alias at the end
alias update_linux='sudo apt-get update'
Don't forget to refresh the .bashrc
configuration, by running:
source ~/.bashrc
for more details on creating alias you can read following blog: Codebucket.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With