*nix – Locate files modified after specified datetime (CentOS 5)

This is basic stuff, but it took me a little while to find decent instructions and they still needed tweaking so for my own reference as much as anything:

Commands

touch
and
find

Syntax

$ touch -t mmddhhmm /path/to/tmp/file $ find /path/to/search/ -newer /path/to/tmp/file -print

[month][day][hour][minutes], so 10:25pm on Apr 19th is
04192225

Example

$ touch -t 04192225 /var/www/vhosts/{domain}/timesearch/findresult.txt $ find /var/www/vhosts/{domain}/httpdocs/components/com_community/ -newer /var/www/vhosts/{domain}/timesearch/findresult.txt -print

Output:
/var/www/vhosts/{domain}/httpdocs/components/com_community/controllers/frontpage.php /var/www/vhosts/{domain}/httpdocs/components/com_community/templates/agiles_social/activities.index.php /var/www/vhosts/{domain}/httpdocs/components/com_community/templates/agiles_social/params.ini

2 thoughts on “*nix – Locate files modified after specified datetime (CentOS 5)”

  1. Damn posterous! Wrong topic again.Even print_r in pre tags can be a bitch to read if it’s a large chunk of JSON. I was happy to do that until I had a massive JSON chunk to deal with…

Leave a Reply

Your email address will not be published. Required fields are marked *