This question already has an answer here:
Sometimes I want to know what a command I type into
bash actually evaluates to. Usually I can figure out the location of the executable very easily with
$ which vim /usr/bin/vim
But what if I've created an alias for
$ alias vim="echo mwahaha" $ which vim /usr/bin/vim
Hmm, not good. If I suspect something and want to check if
vim has been aliased, I know I can type
... but if I had an
alias vim='vim -p', I would never actually think to check
vim aliases because it would still work just fine.
How can I know exactly what a specific command in
bash is being evaluated to?