The Situation:
I have several directories with various GUN/Linux e-books in them. The names of the e-books have the publication date in them, but not in the same place. What I wanted to do was get a list of the books sorted by the publication date.
My Solution:
The solution I used was to create a column of the years and then a second column that listed all the file names. Then all that needed to be done was to sort based on the year column, which was even simpler because it was the first column. However, this seems quite slow, anyone have a better solution?
for book in Linux\ */*; do echo “$(echo ${book##*/} | egrep -o ‘[0-9]{4}’) : ${book##*/}”; done | sort