where command not found os x

13,770

Solution 1

"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.

Solution 2

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.)

Share:
13,770
lostAstronaut
Author by

lostAstronaut

Updated on July 27, 2022

Comments

  • lostAstronaut
    lostAstronaut almost 2 years

    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?