-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux locate Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to locate on Linux, covering Arch Linux, CachyOS, and other distributions including finding files by name, updating database, and fast file searching.
- Understanding locate
- locate Installation
- locate Basics
- Search Options
- Database Management
- Troubleshooting
locate finds files by name using database.
Features:
- Fast search: Uses pre-built database
- Name search: Find files by name
- Quick results: Very fast searching
- Database-based: Uses mlocate database
Why it matters:
- Fast searching: Much faster than find
- File location: Quickly find files
- System exploration: Explore filesystem
Arch/CachyOS:
# Install mlocate
sudo pacman -S mlocate
# Initialize database
sudo updatedbDebian/Ubuntu:
sudo apt install mlocate
sudo updatedbFedora:
sudo dnf install mlocate
sudo updatedbBasic usage:
# Find file
locate filename.txt
# Shows all matchesWildcard search:
# Pattern search
locate "*.txt"
# All .txt filesIgnore case:
# Case insensitive
locate -i filename
# -i = ignore caseLimit output:
# Limit results
locate -l 10 filename
# -l = limit (first 10)Refresh database:
# Update database
sudo updatedb
# Rebuilds search databaseFind database:
# Database location
ls -la /var/lib/mlocate/mlocate.db
# Or
locate -SUpdate database:
# File might be new
# Update database
sudo updatedb
# Then search again
locate filenameThis guide covered locate usage, file searching, and database management for Arch Linux, CachyOS, and other distributions.
- find Guide - Advanced file searching
- which Guide - Find commands
- updatedb Guide - Database updates
-
locate Documentation:
man locate
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.