« Back to Index

Search Tips

View original Gist on GitHub

Tags: #shell

Search Tips.md

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.