Find files by name using an index
low risk
Searches an index of filenames built by updatedb — much faster than find but only as fresh as the last index run.
| Flag | Meaning |
|---|---|
-i | Case-insensitive match |
-c | Count matches only |
-n | Limit the number of results |
-b | Match the basename only |
locate -i nginx.confCase-insensitive search · explain & risk-check →locate -c "*.log"Count log files in the index · explain & risk-check →Reference text is hand-written and may be incomplete — check man locate for your version. Test destructive commands on a non-production system first.