Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are alias' stored in Ubuntu 10.04

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?

like image 943
JZ. Avatar asked Feb 12 '12 00:02

JZ.


People also ask

Where are aliases stored in Kali Linux?

They are typically placed in the ~/. bashrc (bash) or ~/. tcshrc (tcsh) startup files so that they are available to interactive subshells.

Where can I find aliases in Linux?

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.

Where are aliases stored bash?

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 .


2 Answers

It depends upon your environment and configurations. For bash, I would generally put it in a .bashrc file that in a home directory.

like image 81
ranendra Avatar answered Sep 29 '22 03:09

ranendra


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.

like image 36
Arvind Avatar answered Sep 29 '22 05:09

Arvind