Shell script to get the oldest file
Hopefully someone else might find this bit of code handy too. I used it in a shell script to get the oldest numbered file in a series of files (eg the oldest file from a set of file_1.gif, file_2.gif, file_3.gif, file_4.gif etc)
ls /mnt/nfs/data/file_*.gif –sort=time | tail -1 | cut -d _ -f 2 | cut -d . -f 1