How to find where a command resides in bash.

in «tip» by Michael Beard
Tags: , , , ,

There are many times that I have no idea of where a command I use actually resides in the system. Sometimes I do, and what I'm calling is not the command that I know it should be, so ... How do you tell where the command that works from the command line actually resides on your system?

This link, Shell - How to find directory of some command? has many good ways to find this out, so I wanted to save the link.

What worked for me was the following:

type -a <some_command_I_dont_know_where_it_is>

I used it like this:

type -a it2attention

it2attention is aliased /Users/bea704/.iterm2/it2attention

Exactly what I wanted.

There are other methods listed here that are useful as well, but I'm not going to list them. If the above doesn't do what you need, then you can go to the link.