Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
What I am trying to do is to move the old files in our system to a new archive forlder, these old files are ended with a date extension, which is in various date formats. For example:
file1.20070823
file2.08232007
file3.070823
file4.082307
file5.8232007
.....Can someone help me on the command to find the files with the date extesions as listed above? Any help would be appreciated.

The problem I see is that there is no sane format to the date extensions. What do they have in common over other files that may be in the directory? Do they all contain more than 6 numbers? Are they all going to one folder or are you trying to put then into sub folders based on year/date?

Thank you for your reply. Sorry, please disregard my original message. Actually, the date extensions do have the same formats, which is file.yyyymmdd. F
or example:
file1.20070823
file2.20060501
file3.20050101
........I'd like to know the command to find all files with the date extensions as listed above. thank you.

Depending on the naming convention you could use a simple find command.
Are all of the file names(file1, file2, etc) the same? Do all of the extensions start with 2007?
find . -name file*.2007* would work.
or if the extension(year portion) goes back further just bump the 7 off.
find . -name file*.200*
That'll find everything with file as the prefix including any number to follow before the "." then will find any files with extensions starting with 200 so it'll cover 2000, 2001, ...,2007.
Hope this helps. If you can give more specific file names I could help a little better.
Regards
~Verta

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |