# This is *NOT* a useless use of cat. cat $file |\ perl -ne 'printf "%04d%02d%02d %s", (split '/')[2,0,1], $_' |\ sort |\ cut -d ' ' -f 2