Based from this question, The HTML files date format has been changed. All of the HTML files have the date such like below:
20110730dateishere dateishere is intentionally added by me in the files, so I can easily pinpoint those date location.
And now, in the directory of the HTML files, I want to move one file at a time based on that date.
If move one file at a time without care about which file moved first, I can simply use
for file in $(ls | tail -1); do mv $file /other/location done But how to move the oldest file first based on the date in XXXXXXXXdateishere? (this means, HTML file contains 20100110dateishere moved first before 20100111dateishere, and then next file; based on the date)
(note: 20100111 means 11 January 2010)