find command generator
Build a Linux find command by filling in what you are looking for: a path, a name pattern, a file type, a size or age threshold, and what to do with the matches. The command updates live with every flag explained, and a red warning appears whenever you choose a destructive action like -delete. Everything is assembled in your browser.
What this find command generator does
The find command walks a directory tree and tests every entry against the criteria you give it, then performs an action on the matches. It is the single most useful command for locating files by name, size, age, type or permission, and for running an operation on each result. Its syntax is expression-based rather than flag-based, which trips up newcomers: criteria are read left to right and combined, and the action comes last. This generator turns the criteria into plain dropdowns and builds the correct expression for you.
A command like find . -type f -name "*.log" -mtime +30 -delete reads as: starting in the current directory, for every regular file whose name ends in .log and that was modified more than 30 days ago, delete it. Each token is a test except the final -delete, which is the action. Because find can delete or execute commands on thousands of files in one pass, building the expression carefully matters.
How find criteria combine
- Path comes first and sets where the search starts. Use
.for the current directory or an absolute path like/var/log. - -maxdepth N is a global option that limits recursion depth; it must appear before the tests.
- -name / -iname match the filename against a shell glob. Quote the pattern so the shell does not expand it before
findsees it. - -type restricts to files (
f), directories (d) or symlinks (l). - -size takes a
+for larger,-for smaller, or no prefix for exact, with a unit (k,M,G,cfor bytes). - -mtime / -mmin filter by modification age in days or minutes;
+7means older than 7,-1means within the last 1.
Actions: print, delete and exec
By default find prints each match, which is the safe way to preview what your criteria select. The -ls action prints a detailed ls -l style line. The -delete action removes matches and cannot be undone, so always run the same command without -delete first to confirm the list. The -exec action runs an arbitrary command on each match, with {} standing in for the file path; ending the exec with + instead of \; batches many files into one invocation for speed.
Safety: preview before you delete
The golden rule with find is to preview first. Run your full command with the default print action, eyeball the list, and only then swap in -delete or -exec rm. A misplaced pattern or a wrong path can otherwise wipe far more than you intended. This generator shows a red warning whenever a destructive action is selected, precisely because -delete traversing the wrong directory is one of the classic ways to lose data.
Privacy and how this tool runs
The command is built by JavaScript in your browser. No paths, patterns or commands leave your machine, and there is no logging. You can use the generator offline once the page has loaded.
Frequently asked questions
How do I find files by name in Linux?
Use find . -type f -name "*.txt" to find regular files ending in .txt under the current directory. Use -iname instead of -name to ignore case. Always quote the pattern so the shell passes it to find unchanged.
How do I find large files?
find / -type f -size +100M lists files larger than 100 megabytes anywhere on the system. Change the unit to G for gigabytes. Pipe to sort or add -exec du -h {} + to see and sort the sizes.
How do I find and delete files older than 30 days?
find /path -type f -mtime +30 -delete. Run it first without -delete to confirm the list, then add it. For log rotation prefer a dedicated tool like logrotate, but find is perfect for ad-hoc cleanup.
What is the difference between -exec {} \; and {} +?
Both run a command on matches. \; runs the command once per file, which is simple but slow for many files. + appends as many files as fit into a single command invocation, which is much faster and is the preferred form when the command accepts multiple arguments.
Why must -maxdepth come before other tests?
-maxdepth is a global option that affects the whole traversal, not a per-file test. GNU find warns if it appears after a test because the placement is misleading. Put it immediately after the path, which is exactly what this generator does.
Should I use find or fd?
fd is a modern, faster, friendlier alternative with simpler syntax and colour output, great for interactive use. find is universal, present on every Unix system, and scriptable without extra installs. Learn find for portability and scripts; reach for fd at the terminal when it is installed.
Related tools and resources
More command builders from the same toolkit.













