I'm trying to find where a specific alias
has been declared. I've searched all the usual places I know to look for aliases:
- ~/.bashrc
- ~/.bash_profile
- /etc/bashrc
- /etc/profile
With no luck.
I know it's an alias
because when I do which COMMAND
, I get:
alias COMMAND='/path/to/command'
/path/to/command
Is there a way to find what file declares an alias
only knowing the alias
name?
Best Answer
I would look in
/etc/profile.d/
for the offendingalias
.You could also do the following to find it:
This will recursively
grep
through files looking for a line beginning withalias COMMAND
.If all else fails, put this at the end of your
~/.bashrc