Bash – How to find the path to an executable in OSX

bashmac-osxterminal

Is there a command I can use to easily find the path to an executable? I'm looking for identify on my local machine – something like pwd?

pwd identify
=> /usr/local/bin/identify

Best Answer

which will search your path for the arguments you supply, it's found on just about any BSD or SysV UNIX

moriarty:~ dave$ which bash true false
/bin/bash
/usr/bin/true
/usr/bin/false