Sample Header Ad - 728x90

What is the difference between which and where

23 votes
2 answers
12011 views
What is the difference between where and which shell commands? Here are some examples ~ where cc /usr/bin/cc /usr/bin/cc ~ which cc /usr/bin/cc and ~ which which which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' /usr/bin/which ~ which where /usr/bin/which: no where in (/usr/local/bin:/bin:/usr/bin:/home/bnikhil/bin:/bin) also ~ where which which: aliased to alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde which: shell built-in command /usr/bin/which /usr/bin/which ~ where where where: shell built-in command To me it seems that they do the same thing one being a shell builtin, not quite sure how that is different from a command?
Asked by nikhil (1062 rep)
Feb 5, 2013, 12:30 PM
Last activity: Oct 4, 2023, 05:19 PM