find

Recursively search for files by name, type, size, time, and more.

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

find is the most powerful file search tool on Linux. It supports filtering by name, type, permissions, size, modification time, and more — and can execute arbitrary commands on matches with -exec. Essential for cleanup, auditing, and automation.

Common flags
FlagMeaning
-nameMatch by filename (case-sensitive)
-inameMatch by filename (case-insensitive)
-typeFilter by type: f (file), d (dir), l (symlink)
-mtimeMatch by modification time in days
-sizeMatch by size (e.g., +100M)
-execExecute command on each match
-maxdepthLimit recursion depth
Examples
find /var/log -name '*.log' -mtime +30 -deleteDelete log files older than 30 days · explain & risk-check →
find / -perm /4000 -type f 2>/dev/nullFind all SUID binaries (security audit) · explain & risk-check →
find . -name '*.tf' -exec grep -l 'aws_s3_bucket' {} \;Find Terraform files referencing S3 · explain & risk-check →
find /home -size +100M -type fFind large files in home directories · explain & risk-check →
find . -type f -newer reference.txtFiles newer than a reference file · explain & risk-check →
Pro tip

Use `-exec cmd {} +` instead of `-exec cmd {} \;` — the `+` variant batches arguments (like xargs), dramatically faster for large result sets.

Related
xargs grep ls
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man find for your version. Test destructive commands on a non-production system first.