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.
locateIncorrect. locate only queries the existing database.
whereisIncorrect. whereis searches standard command locations.
whichIncorrect. 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のみ
- 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
A new file becomes searchable by locate only after the next database refresh includes it.
Check the side effect
Refresh indexes under the system's normal privilege and scheduling policy rather than ad hoc in production.