Find files by name with find

Locate that missing document or all files matching a pattern, searching every subfolder.

LinuxsearchfindLow risk
Run find ~/Documents -iname '*.pdf' to list every PDF under Documents, case-insensitively.

01Command

Command
$ find ~ -iname '*invoice*.pdf' 2>/dev/null && find . -name '*.log' -mtime -7

02What it does

find takes a starting directory and filters: -name '*.pdf' matches exact case, -iname ignores case. Combine criteria — find . -name '*.log' -mtime -7 finds logs modified in the last 7 days. Quote the pattern so the shell doesn't expand it, and add 2>/dev/null to hide 'permission denied' noise in system folders.

03Risk

RiskLow risk
!Warning: Running find on / searches the entire system and can take minutes; start from the narrowest directory you can. With -delete or -exec it acts on what it finds — always print the list first before deleting anything.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • find(1) — Linux manual page
    man7.org · community · 2026-09-17
    Evidence: find walks a directory tree testing each file against -name/-iname patterns and other criteria such as -mtime, printing matching paths.

Last verified: 2026-09-18 · Category: Files & Folders

06Related solutions