🐧 Linux / Shell Scripting
Beginner
What are which and whereis used for?
Answer
which command shows the full path of the executable that will be run when you type a command in your shell, by searching the directories in $PATH: which python3 might return /usr/bin/python3. It only returns the first match — useful for checking which version of a tool is active. whereis command is broader — it searches for the binary, source code, and man page: whereis python3 returns all locations found in standard system directories. Use type command in bash for a more comprehensive answer that also identifies shell built-ins, aliases, and functions vs external binaries.