Search the system filename database for paths containing project-notes.
It is acceptable that results reflect the most recent database update.
Which command is appropriate?
locate searches a database built by updatedb, making it fast but potentially stale compared with a live find traversal.
Detailed explanation
find / -name '*project-notes*'Incorrect. find scans the current filesystem and may be slower for this database-oriented request.
Incorrect. find scans the current filesystem and may be slower for this database-oriented request.
which project-notesIncorrect. which resolves an executable on PATH.
Incorrect. which resolves an executable on PATH.
whereis project-notesIncorrect. whereis searches standard command locations.
Incorrect. whereis searches standard command locations.
locate project-notesCorrect. locate project-notes searches the filename database.
Correct. locate project-notes searches the filename database.
Try it yourself
An example you can run in a temporary verification environment.
locate --help 2>/dev/null | sed -n '1,2p' || trueExpected result
locateが導入済みなら使用法。ファイルシステムは変更しないKey points
- locate uses a database
- Fast but may be stale
- find traverses current state
Notes
- Environment: Linux / locate実装が導入済みの場合 / helpのみ
- 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.