Drew Sanderson
Drew Sanderson

Reputation: 3

Find files in OS X by creation time, date is irrelevant to the search

I have an hourly cron that has been dumping CSV files into one folder for a year. I now have a need to grab all the files created sometime in the 8:00PM hour that are all located in this folder so that I can import just them into a database. How can I find and copy just these files out to another folder? The filename is structured like this: 2014_9_1_20_10_55.csv or said another way, yyyy_mm_dd_hh_mm_ss.csv

Upvotes: 0

Views: 53

Answers (1)

Barmar
Barmar

Reputation: 781058

Use a wildcard:

cp *_*_*_20_*_*.csv other_folder

Upvotes: 5

Related Questions