ls is helpful in most of the cases, but sometimes it is not a good idea.
To have a 100% sure solution, you can use the
find command and make it print the last time all files were accessed. By printing it in a numeric way, they you can sort the list and print the last one.
find /your/path -maxdepth 1 -print0 | xargs -0 stat -c "%Y %n" | sort -n | tail -1 | cut -d' ' -f2-
-maxdepth 1 does not go deeper in the directory structure.
xargs -0 stat -c "%Y %n" gets the file name and prints its time of last modification plus the name of the file. (from
man stat: "%Y time of last modification, seconds since Epoch")
sort -n orders the list numerically, being the first the oldest.
tail -1 gets the last of the list.
cut -d' ' -f2- removes the printing of the datetime.