Find Command Generator
Build accurate, copy-ready find commands for locating files, auditing permissions, troubleshooting systems, and routine administration.
Define the search
Advanced filters
Result action
Predefined day-to-day commands
Find a file by exact name
Search below the current directory for an exact filename.
find . -type f -name 'report.pdf'Find files ignoring case
Match README, readme, ReadMe, and other case variations.
find . -type f -iname 'readme*'Find all log files
Locate files ending in .log below /var/log.
find /var/log -type f -name '*.log'Files modified today
Find regular files changed within the last 24 hours.
find . -type f -mtime -1Files older than 30 days
Review old files before archiving or deleting them.
find /path/to/data -type f -mtime +30 -printLarge files over 1 GB
Locate regular files larger than one gigabyte.
find / -xdev -type f -size +1G 2>/dev/nullEmpty files
Find zero-byte regular files.
find . -type f -emptyEmpty directories
Find directories that contain no entries.
find . -type d -emptyDirectories only
List every directory under the current path.
find . -type dExecutable files
Find regular files executable by the current permission test.
find . -type f -executableWorld-writable files
Audit files writable by any user.
find /path/to/check -type f -perm -0002 -printOwned by a user
Find files and directories owned by a specified account.
find /home -user username -printBroken symbolic links
Locate symbolic links whose targets no longer exist.
find . -xtype lLimit search depth
Search only the starting folder and one level below it.
find . -maxdepth 2 -type fFind multiple extensions
Match either JPG or PNG files, ignoring case.
find . -type f \( -iname '*.jpg' -o -iname '*.png' \)Show detailed results
Display find matches using an ls-style detailed format.
find . -type f -name '*.conf' -lsRun a safe command per match
Display file information through stat without changing files.
find . -type f -name '*.txt' -exec stat -- '{}' \;Delete old temporary files
Destructive example: preview first, then delete matching files.
find /tmp -type f -name '*.tmp' -mtime +7 -deleteNo matching scenario found.
How to use Linux find safely
Choose a starting path
Use . for your current directory or a specific directory such as /var/log.
Add focused tests
Combine type, name, size, age, owner, permissions, and depth to reduce unwanted matches.
Preview the matches
Start with -print or -ls. Confirm every result before changing or deleting anything.
Copy and run
Paste the reviewed command into your Linux terminal. Permissions and supported options depend on the system.
Quick option reference
| Option | Purpose | Example |
|---|---|---|
-type f | Regular files only | find . -type f |
-name / -iname | Match a filename, optionally ignoring case | -iname '*.jpg' |
-size | Match by rounded storage unit | -size +100M |
-mtime | Match by modification age in 24-hour periods | -mtime +30 |
-maxdepth | Limit directory recursion | -maxdepth 2 |
-perm | Match permission bits | -perm -0002 |
-exec | Run a command for every matching path | -exec stat -- '{}' \; |
-delete | Permanently remove matches | Preview first |
Use a specific starting path, -type, and -maxdepth. Searching from / can be slow and produce permission errors.
Commands run with sudo, -delete, or a modifying -exec can affect critical system data. Review them carefully.
Your feedback matters