6

I recently came across the command where, which provides the actual path of executables in Linux. I was aware of which, whereis, locate and find, but not where.

I want to know when this command got introduced and why its manual is not available. Is this shell command specific to the C Shell or do all shells have the where command?

6

The only shells I know which has a builtin command called where is the tcsh and zsh. In the manual page of that shell (man tcsh / man zshbuiltins), you can find the definition:

   where command (+)
           Reports all known instances of command, including aliases, builtins and
           executables in path.

Therefore it is the tcsh-equivalent of the bash builtin type (tcsh has no type):

tcsh$ where where
where is a shell built-in
tcsh$ where echo
echo is a shell built-in
/bin/echo
5

where is a shell builtin command in csh

    where where
    where is a shell built-in

the builtin is also available in zsh.

2

The linux command is called which. If you are used to in c-shells this might be a builtin. Bash builtins are documented through the bash builtin help.

From Wikipedia:tcsh

The built-in where command. Works like the which command but shows all locations of the target command in the directories specified in $PATH rather than only the one that will be used.

So I'm right: The where command is a tcsh built-in and not available as an external command. If you pay me 250$ I will write a little C command for you ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.