Find the standard binary and manual locations for the ls command.
This is not an arbitrary file-tree search.
Which command is appropriate?
whereis NAME searches standard locations for a command's binary, source, and manual files.
Detailed explanation
find lsIncorrect. find needs a start path and predicates for arbitrary filesystem searches.
Incorrect. find needs a start path and predicates for arbitrary filesystem searches.
locate --manual lsIncorrect. locate searches its filename index and is not the command-specific binary/manual lookup here.
Incorrect. locate searches its filename index and is not the command-specific binary/manual lookup here.
whereis lsCorrect. whereis ls reports the standard binary and manual locations.
Correct. whereis ls reports the standard binary and manual locations.
updatedb lsIncorrect. updatedb rebuilds a database and does not query one command.
Incorrect. updatedb rebuilds a database and does not query one command.
Try it yourself
An example you can run in a temporary verification environment.
whereis lsExpected result
lsのbinaryとmanual等の候補パスKey points
- Binary
- Manual
- Command name
Notes
- Environment: util-linux whereis 2.39以降
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.