Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where command not found os x

Okay so the title is pretty self explanitory, when I type where ... as a command it returns

-bash: where: command not found

my current bash profile includes :

export PATH="/usr/local/lib:$PATH"
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/lib/node_modules/bin:$PATH"

I googled it for a while and found that most people just need /usr/bin and /usr/sbin which I have both of.

Any ideas?

like image 988
lostAstronaut Avatar asked Apr 21 '12 23:04

lostAstronaut


People also ask

Where is the command prompt in Mac OS X?

To access the Unix command prompt in Mac OS X, open the Terminal application. It is located by default inside the Utilities folder, which in turn is inside the Applications folder.

Where is Mac not found?

Magnetite is sometimes found in large quantities in beach sand. Such black sands (mineral sands or iron sands) are found in various places, such as Lung Kwu Tan of Hong Kong; California, United States; and the west coast of the North Island of New Zealand.

What does command not found mean?

When you're trying to run a command (with or without sudo ) and get an error message that reads "Command not found," this means the script or file you're trying to execute doesn't exist in the location specified by your PATH variable.


2 Answers

"where" is a shell builtin for csh. Is that what you're really looking for?

"which" and "whereis" are under /usr/bin, and tell you where to find a given command.

like image 54
Stuart Avatar answered Oct 10 '22 01:10

Stuart


As Stuart says, where is a tcsh builtin command. It's an extended version of the which command; which tells you what a command name resolves to, and where shows a list of all the places (including aliases, builtins, and executables in $PATH) where a command might be found.

The bash equivalent is type -a.

If you like, you can add this function definition to your .bashrc or .bash_profile:

where() { type -a "$@" ; }

The output isn't in exactly the same format, but it gives you the same information.

(Or you might consider just re-training yourself to use type -a rather than where.)

like image 31
Keith Thompson Avatar answered Oct 10 '22 01:10

Keith Thompson