When I run the alias
command, I see an alias which I don't know where it has been defined (i.e. I cannot find the file which contains definition of this alias). I have checked /etc/profile
, ~/.bashrc
, ~/.profile
, ~/.bash_profile
, ~/.bash_login
, /etc/bash.bashrc
and some others but to no avail.
Is there a way to find out which files the alias
command gets its info from? I mean how does the alias
command work? Does it read some predetermined files looking for alias definitions?
alias <name>=<definition>
commands that have been executed in that shell process since it started. Shells automatically run the commands in the various init scripts at startup (which files are run depends on how the which shell program it is, how it's started, etc). Those can run other scripts (with thesource
or.
commands). You can also define aliases manually. To find out where a particular alias is coming from, you have to trace the shell startup process.