Last updated
Common Find Recipes
- Clean Java build:
find . -name "*.class" -delete - Clean Python cache:
find . -name "__pycache__" -type d -exec rm -rf {} + - Find large files:
find / -size +1G -type f 2>/dev/null - Find recently changed configs:
find /etc -mtime -1 -type f - Find broken symlinks:
find . -xtype l - Find duplicate names:
find . -name "*.bak" -type f
The Find Command Generator on TechConverter.me handles all of find's complex syntax — time-based searches, permission expressions, -prune exclusions, and -exec actions — through a simple visual interface that generates correct, ready-to-run commands every time.
Examples
Example 1: Find Files by Name Pattern
# Find all Python files in the current directory tree
find . -name "*.py" -type f
# Find all test files (case-insensitive)
find . -iname "*test*" -type f
# Find files matching a regex pattern
find . -regex ".*\.\(js\|ts\|jsx\|tsx\)$" -type f
# Find files NOT matching a pattern
find . -name "*.log" -not -name "error.log" -type f
Example 2: Find Files by Modification Time
# Files modified in the last 7 days
find . -mtime -7 -type f
# Files modified more than 30 days ago
find . -mtime +30 -type f
# Files modified in the last 24 hours
find . -mtime -1 -type f
# Files modified between 7 and 30 days ago
find . -mtime +7 -mtime -30 -type f
# Files modified in the last 2 hours
find . -mmin -120 -type f
Note: -mtime +1 means "more than 48 hours ago" (not 24 hours).
The generator handles this confusing counting automatically.
Example 3: Find Files by Size
# Files larger than 100 MB
find . -size +100M -type f
# Files smaller than 1 KB (likely empty or near-empty)
find . -size -1k -type f
# Files between 1 MB and 10 MB
find . -size +1M -size -10M -type f
# Empty files
find . -empty -type f
# Empty directories
find . -empty -type d