command -v ls

Category: Administration

command -v ls

Print the path a command would run

command -v is the POSIX-standard way to ask which binary the shell would execute, and unlike which it understands aliases and builtins. For a builtin like cd it prints the name itself instead of a path. Scripts use it to locate tools before calling them.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.