How to search for a file that has the date in the filename nomenclature
Hi all,
I am new to unix/linux. I am seeking your assistance on know how to do a search for a file that has the date in the filename. The date obviously changes. Any help is greatly appreciated. DYYMMDD.CUSA I am lost :/ |
I would recommend the following:
find / -name DYYMMDD.CUSA 2>/dev/null So if you were looking for a file with a date of Nov 6th 2008 you would do: find / -name D081106.CUSE 2>/dev/null |
Might try locate:
Code:
$ locate 101107 |
Thank you for your reply centos62. However, the filename changes as the date changes.
Quote:
|
Code:
find / -name D[0-9][0-9][0-9][0-9][0-9][0-9].CUSA Cheers, Tink P.S.: Please use proper quoting. TOFU sucks. |
I apologize if I didn't explain myself properly. I need to have a script in place to automatically download a file that has the previous day date in the filename. I am sorry for the confusion that I generated.
DYYMMDD.CUSA Thanks to everybody :) |
I don't think your requirments have been fully stated yet. Will you always be downloading yesterdays file? Will the file always be located in the same directory?
If you provide some sort of pseudo code, then I'm sure someone here could provide the actual script code. |
find / -name D`date --date="1 days ago" +%y%m%d`.CUSA
you can replace find with wget, scp Rohit Kalsarpe |
All times are GMT -5. The time now is 12:57 AM. |