Linux Find and Locate Cheat Sheet

Powerful Linux search commands using find, locate, xargs, and metadata filters.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Find by Name and Type

Find file by exact name

Search recursively for a specific filename.

bashANYfindname
bash
find /var/log -name 'syslog'

Case-insensitive name search

Match names regardless of case.

bashANYfindcase-insensitive
bash
find . -iname '*.jpg'

Find directories only

Restrict results to directories.

bashANYfinddirectories
bash
find . -type d -name 'node_modules'

Find by Size and Time

Find files larger than 100 MB

Search for large files using size filters.

bashANYfindsizecleanup
bash
find / -type f -size +100M 2>/dev/null

Find files modified in last 1 day

Use mtime to find recently modified files.

bashANYfindmtimerecent
bash
find . -type f -mtime -1

Find files accessed more than 30 days ago

Identify stale files.

bashANYfindatimestale
bash
find . -type f -atime +30

Find files newer than reference file

Compare timestamps using a reference path.

bashANYfindtimestamps
bash
find . -type f -newer reference.txt

Find by Permissions and Ownership

Find world-writable files

Audit overly permissive files.

bashANYfindpermissionssecurity
bash
find /var/www -type f -perm -002

Find files owned by user

Search by owner name.

bashANYfindownership
bash
find /home -user alice

Find files owned by group

Search by group ownership.

bashANYfindgroupownership
bash
find /srv -group www-data

Find files with missing user

Audit orphaned ownership.

bashANYfindownershipaudit
bash
find / -nouser 2>/dev/null

Actions and locate

Delete old temporary files

Remove matching files directly from find.

bashANYfinddeletecleanup
bash
find /tmp -type f -name '*.tmp' -delete

Run chmod on matched files

Execute a command on each result.

bashANYfindexecchmod
bash
find . -type f -name '*.sh' -exec chmod +x {} +

Locate files using database

Search quickly using updatedb database.

bashANYlocatesearch
bash
locate nginx.conf

Refresh locate database

Update file index used by locate.

bashANYlocateupdatedb
bash
sudo updatedb

More in Linux Find and Locate

No other published sheets yet.

Recommended next

No recommendations yet.