Yeah I know generally we pretty much always want to find older files but there are some use cases where finding newer files than a certain date time is a requirement.
Ok being no where near to your Linux expertise, I will show you how I do it, you can show your approach to this problem by leaving your comment
First step
Create a random file with a timestamp as shown below
1 2 3 |
> > touch --date "Wed Jan 8 01:00:11 EST 2014" /tmp/dummy; > |
Second Step
We will now find our files that are newer than the timestamp of our dummy file as shown below
1 |
> find /path/to/folder/* -newer /tmp/foo -type f |
If you want to show timestamps too with the listed file here is a modification to above command
Showing timestamps
1 |
> find /var/www/html/BackupAssistV5/diags/* -newer /tmp/foo -exec stat \{} --printf="%y %n\n" \; |
As said this is just one of a few approaches that you can use. With newer version of *ix you should also be able to use
1 |
-newermt |
command line switch. To get more details on find command either use >man find or browse to http://unixhelp.ed.ac.uk/CGI/man-cgi?find to find more options that you can use.
I hope this helps. Also a very happy new year 2014
Cheers,
Leave a Reply