Skip to content
Latchkey

find -mmin: Select Files by Minutes

find -mmin selects files by modification age measured in minutes.

When days are too coarse, -mmin pinpoints what changed in the last few minutes, for example artifacts a build step just produced.

What it does

find -mmin N matches files modified exactly N minutes ago; +N means more than N minutes ago and -N means within the last N minutes. It is the minute-granularity counterpart to -mtime.

Common usage

Terminal
find dist -type f -mmin -10        # built in the last 10 minutes
find /tmp -type f -mmin +60 -delete
find . -type f -amin -5            # accessed in last 5 minutes

Options

ExpressionWhat it does
-mmin +NModified more than N minutes ago
-mmin -NModified within the last N minutes
-mmin NModified exactly N minutes ago
-amin / -cminAccess / inode-change time in minutes

In CI

Use -mmin -N to capture exactly the files a previous step just wrote, which is handy for collecting fresh artifacts without listing the whole tree. The sign convention matches -mtime: minus for recent, plus for old.

Common errors in CI

-mmin, -amin, and -cmin are GNU extensions and are not in classic BSD find; macOS ships BSD find but does support -mmin, so it usually works on Mac runners. If a script must be portable to a minimal BSD, fall back to -newer against a touched reference file.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →