Search PATH to see which executable runs when the user types python3.
Alias or shell-function details are not needed.
Which command is appropriate?
which searches PATH directories and prints the executable corresponding to a command name.
Detailed explanation
which python3Correct. which python3 reports the PATH-resolved executable.
whereis python3Incorrect. whereis searches standard locations for binaries, sources, and manuals.
locate python3Incorrect. locate searches its filename database rather than command resolution.
find python3Incorrect. find requires a start path and predicates.
Try it yourself
An example you can run in a temporary verification environment.
which shExpected result
/usr/bin/shや/bin/shなど、PATH上のshのパスKey points
- which searches PATH
- whereis covers several kinds
- locate searches a database
Notes
- Environment: Linux / which / 現在のPATHを照会
- Use read-only lookups or disposable paths when verifying search behavior.
- Distribution-specific defaults should be checked before changing system configuration.
Foundation review
Place the operation
which answers where a command name resolves on PATH; it is narrower than a general filesystem search.
Check the side effect
Compare the result with the shell's own resolution when aliases or builtins could be present.