Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

locate

Quickly find files by name

Syntax

locate [OPTION]... PATTERN...

Common Options

-iIgnore case
-cShow only count
-rUse regex
-wMatch whole path
-bMatch basename only
-nLimit output count
-eShow only existing files
-SShow database stats

Common Examples

locate nginx.conf

Find nginx config

locate -i readme

Case-insensitive search

locate -c "*.py"

Count Python files

locate -n 5 "*.conf"

Limit to 5 results

locate -r "\.sh$"

Regex search for .sh files

locate -S

Show database stats

Related Commands

Related Tools

More Code & Dev Tools