How do I list all files under a directory recursively and sort the output by modification time?
I normally use
ls -lhtc but it doesn't find all files recursively. I am using Linux and Mac.
ls -l on Mac OS X can give
-rw-r--r-- 1 fsr user 1928 Mar 1 2011 foo.c -rwx------ 1 fsr user 3509 Feb 25 14:34 bar.c
where the date part isn't consistent or aligned, so a solution have to take this into account.
stat -f "%m%t%Sm %N" ./* | sort -rn | head -3 | cut -f2-
works, but not recursively.