Hi there!
I was wondering if someone could help me with the following:
I'm trying to find all files within a directory which have been modified since midnight of the current date.
Any help would be appreciated.
Thank you kindly.
Hi there!
I was wondering if someone could help me with the following:
I'm trying to find all files within a directory which have been modified since midnight of the current date.
Any help would be appreciated.
Thank you kindly.
Use touch
to set a file with the desired start time and then use:
find directory_name -newer start_time_file ...
to list your desired files.
Hi there,
Thank you for your reply, but could you please tell me how I would go about not hard-coding a specific filename, rather hard coding a specific time (00:00:00)?
Thank you.
I did!
Did you look at the touch
man page to see how to create a file with a given timestamp? Did you look at the find
man page to see how the -newer file
primitive can be used to find files newer than a given timestamp?
This is the Shell Programming And Scripting forum (not the UNIX for Dummies Questions & Answers forum), so I assumed that you just needed a couple of pointers in the right direction.
Try:
touch -t $(date +%Y%M%D0000) start_time_file
find directory_pathname -newer start_time_file
----------------
See correction in later post. The date
format string is wrong.
Hiya Don,
Thanks for the help
Oops. That date
command should have used a different format string.
Try:
touch -t $(date +%Y%m%d0000) start_time_file
find directory_pathname -newer start_time_file
Yeah I picked up on that, cheers!