find
Locate files by name, type, size, time, and more. Combine with -exec for powerful workflows.
Synopsis
find [path] [expression]
Core Options
-name 'pattern'Match by filename (case-sensitive).
-type f|d|lFilter by file type (file/dir/link).
-mtime +/-NModified time in days.
-size +/-NFile size (e.g., +100M).
-maxdepth NLimit directory traversal depth.
-exec cmd {} \;Run a command for each match.
-print0Null-terminate output for safe piping to xargs -0.
Usage Examples
Find Large Files
Find files over 100MB.
find . -type f -size +100MFind by Extension
Find all .log files up to 2 levels deep.
find . -maxdepth 2 -type f -name '*.log'Find Recently Modified
Files modified in the last 24 hours.
find . -type f -mtime -1Delete Matching Files
Delete all .tmp files safely.
find . -type f -name '*.tmp' -deleteExec Command
Run wc -l on each Python file.
find . -type f -name '*.py' -exec wc -l {} \;Built for builders.