Find Command Builder

Build a Linux find command without memorising the expression grammar. Pick where to search, then describe the files you want: a name or glob, one or more extensions, a type, a size, an age, and a permission mode. The command is assembled as you type, with every flag explained in plain English and a validation panel that catches the mistakes that silently return nothing — an unquoted wildcard that the shell expands before find ever sees it, a -name pattern containing a slash (it only matches basenames), or a -perm mode that matches far more files than you meant. Already have a find one-liner you don’t fully understand? Paste it into the import panel and it is broken back into form fields. Everything runs in your browser, nothing is uploaded, and no command is executed here.

100% private. The builder, the paste-to-parse importer and the generated script are all created with JavaScript in this tab. No filenames, paths or commands are sent to this website or to anyone else, and nothing is ever executed — you review the command and run it yourself.

Quick starts

1. Where to search

2. What to match

Size
-size +100M means “more than 100 MiB”. Rounding is up to the next unit, as GNU find documents.
Age
Days map to -mtime / -atime / -ctime; minutes map to -mmin, -amin, -cmin.
Permissions
“All” emits -perm -644, “any” emits -perm /u+w. Symbolic modes like u+w are safer than raw octal.

3. What to do with the results

Generated command

Ready

Checks on this command

What each part does

PartPlain English

Paste an existing find command

Drop a command you already have (from a script, a Stack Overflow answer or your shell history) and the form is filled in from it. Anything the form cannot represent is listed so you know what will be dropped.

or

A loaded file is read with the browser’s FileReader — it is never uploaded.

How it works

A find command is a path followed by an expression. The expression is a list of tests (-name, -size, -mtime, -perm) and actions (-print, -delete, -exec). Adjacent tests are joined by an implied -a (AND), while -o means OR — and because AND binds tighter than OR, an OR test that belongs together has to be wrapped in escaped parentheses, which is why several extensions are generated as \\( -name '*.log' -o -name '*.gz' \\).

This builder writes every pattern and path in single quotes. That matters: without quotes the shell expands *.log against your current directory before find runs, so the command quietly searches for whatever happened to be in the working directory. The depth options must also come before the tests on some older non-GNU find builds; the builder always emits them in the position GNU find expects.

Paths are only ever matched by name here — -name and -regex compare against the basename, so -name 'var/log/*.log' can never match. Use the starting directory plus a -name '*.log' instead, or switch to -path by hand if you really need a full path match.

The -prune clause is the difference between a fast search and a slow one: it stops find descending into .git or node_modules at all. When a -prune clause is present the expression becomes PATH \\( -type d -name .git \\) -prune -o TESTS -print, so the explicit -print is required for results to appear at all.

The find tests this builder uses

TestWhat it matchesGotcha
-name / -inameBasename against a shell glob (-iname ignores case).Needs quoting; never matches across a /.
-regexWhole path against an Emacs-style regex by default.Use -regextype posix-extended in GNU find if you expect ERE syntax.
-typef file, d directory, l symlink, s socket, p pipe.Symlinks are only followed with -L.
-size+N greater than, -N less than, in units c bytes, k KiB, M MiB, G GiB.Without a unit GNU find counts 512-byte blocks.
-mtime / -mminModification age in days or minutes: +30 older, -1 within.-mtime rounds down, so -mtime +30 is really “31 days or more”.
-newermtFiles modified after a date GNU date can parse.Quote the date so the shell keeps it together.
-perm644 exact, -644 all bits set, /644 any bit set.-perm 644 is exact; a file with 755 will not match.
-emptyZero-length files and empty directories.Only valid for files and directories.
-deleteDeletes every match.Implies -depth; refuses to remove non-empty directories.

Luke Keam
Spot a bug or want a custom utility built? I'd love to hear from you. Get in touch
Luke Keam | techgeek.biz