locate
Quick Reference
Command Name:
locate
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
File search
Search for files and directories based on name
- 2
Quick lookup
Find files quickly without traversing the filesystem
- 3
Scripting
Use in shell scripts to search for files programmatically
- 4
File management
Locate and manage files in the filesystem
Syntax
locate [OPTION]... [FILE]...
Options
| Option | Description |
|---|---|
-l |
Use a long listing format |
-a |
Show hidden entries starting with . |
-h |
Human-readable sizes |
-R |
List subdirectories recursively |
Examples
How to Use These Examples
The examples below show common ways to use the locate command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.