A newly placed file is not yet returned by locate.
Refresh the system pathname database.
Which command performs this role?
updatedb scans filesystems and creates or refreshes the database searched by locate.
Detailed explanation
updatedbCorrect. updatedb rebuilds the database used by locate.
Correct. updatedb rebuilds the database used by locate.
locateIncorrect. locate only queries the existing database.
Incorrect. locate only queries the existing database.
whereisIncorrect. whereis searches standard command locations.
Incorrect. whereis searches standard command locations.
whichIncorrect. which searches PATH.
Incorrect. which searches PATH.
Try it yourself
An example you can run in a temporary verification environment.
updatedb --help 2>/dev/null | sed -n '1,2p' || trueExpected result
updatedbが導入済みなら使用法。データベース更新は実行しないKey points
- updatedb creates and updates
- locate queries
- Update frequency controls freshness
Notes
- Environment: Linux / updatedb実装が導入済みの場合 / 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.