Linux find Cheatsheet
This cheatsheet provides a comprehensive and practical reference for the Linux find command. It covers searching by name, type, size, time, permissions, actions, advanced usage, and command combos. Use it to boost your productivity in file management and automation.
find commands or browse through categories for a complete reference. Explore the Command Combos section for powerful multi-step workflows.Linux Find Cheatsheet
Master the find command for file searching
Commands
Categories
Favorites
Sections
find .List all files recursively
find /pathSearch in specific path
find . -maxdepth 1Current directory only
find . -maxdepth 2Limit depth to 2 levels
find . -mindepth 2Start from depth 2
find . -printPrint full path (default)
find . -print0Null delimiter (for xargs -0)
find . -printf '%f\n'Print filename only
find . -lsList in ls -l format
find . -name 'file.txt'Exact name (case-sensitive)
find . -iname 'file.txt'Name (case-insensitive)
find . -name '*.log'Find all .log files
find . -name '*.jpg' -o -name '*.png'Find .jpg OR .png
find . -not -name '*.txt'NOT ending with .txt
find . -path '**/test/*'Match full path pattern
find . -ipath '**/test/*'Path (case-insensitive)
find . -type fRegular files only
find . -type dDirectories only
find . -type lSymbolic links
find . -emptyEmpty files and directories
find . -type f -emptyEmpty files only
find . -type d -emptyEmpty directories only
find . -size +100MLarger than 100MB
find . -size -10kSmaller than 10KB
find . -size 50MExactly 50MB
find . -size +1GLarger than 1GB
find . -size +100M -size -500MBetween 100MB and 500MB
💡 Size units: c (bytes), k (KB), M (MB), G (GB)
find . -mtime -1Modified in last 24 hours
find . -mtime +7Modified more than 7 days ago
find . -mmin -60Modified in last 60 minutes
find . -newer file.txtNewer than file.txt
find . -atime -1Accessed in last 24 hours
find . -amin -30Accessed in last 30 minutes
find . -newermt '2024-01-01'Modified after date
💡 -mtime: modification, -atime: access, -ctime: status change
find . -perm 644Exact permission 644
find . -perm -644At least 644 permissions
find . -perm -u+xUser executable files
find . -user usernameFiles owned by user
find . -group groupnameFiles owned by group
find . -nouserFiles with no valid owner
find . -exec cmd {} \;Execute for each file
find . -exec cmd {} +Execute with all files at once
find . -ok cmd {} \;Execute with confirmation
find . -print0 | xargs -0 cmdUse xargs (handles spaces)
💡 {} is replaced with filename, \; ends command
find . -type f -deleteDelete found files
find . -exec chmod 644 {} +Change permissions
find . -exec cp {} /dest/ \;Copy files
find . -name '*.log' -mtime +30 -deleteDelete old logs
find . -type f -name '*.txt' -exec grep -l 'pattern' {} +Find files with pattern
find . -type d -empty -deleteRemove empty directories
find . -name 'node_modules' -type d -prune -exec rm -rf {} +Remove node_modules
find /tmp -type f -atime +7 -deleteClean old temp files
Quick Reference
find [path] [options]
c, k, M, G
-mtime (days), -mmin (min)
-exec cmd \;
Categories
- Basic Usage
List files and directories, limit depth, and basic search patterns.
- By Name & Pattern
Search by file name, extension, case, and regex patterns.
- By Size, Time & Permissions
Search by file size, modification/access time, permissions, user, and group.
- Actions
Delete, copy, change permissions, and search content in found files.
- Advanced & Special
Advanced options, hard links, symlinks, filesystem, and execdir.
- Command Combos
Powerful multi-step workflows and advanced usage patterns for real-world scenarios.
Features
- Quick search functionality
- Organized by categories
- Clear command descriptions
- Common and advanced use cases covered
- Easy to copy commands
- Responsive design
- Perfect for quick reference