Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active August 19, 2025 08:53
Show Gist options
  • Save Integralist/fad3f3a20b9be166bd0b0248e8e1a665 to your computer and use it in GitHub Desktop.
Save Integralist/fad3f3a20b9be166bd0b0248e8e1a665 to your computer and use it in GitHub Desktop.
Search Tips #shell

Check if file was modified more than N time ago

The following commands will indicate if the specified file (/tmp/cache-lazy-op) was modified more than 60 minutes ago:

find "/tmp/cache-lazy-op" -mmin +60
fd cache-lazy-op /tmp --type f --changed-before 60m

The find command is more readily available and simpler to remember, but some people prefer more modern tools like fd.

Note

This isn't checking how old the file is, but specifically whether it was last modified over an hour ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment