Use find in conjunction with xargs to pass file names separated by NUL bytes and use a while read while to ensure efficiency and save space:
find /path/to/dir -type f -print0 | xargs -0 ls -t | while read file do ls "$file"
find generates a list of files, ls arranges them by time in this case. To reverse the sort order, replace -t with -tr . If you want to sort by size, replace -t with -s .
Example:
$ touch -d '2015-06-17' 'foo foo' $ touch -d '2016-02-12' 'bar bar' $ touch -d '2016-05-01' 'baz baz' $ ls -1 bar bar baz baz foo foo $ find . -type f -print0 | xargs -0 ls -t | while read file > do > ls -l "$file" > done -rw-rw-r-- 1 bishop bishop 0 May 1 00:00 ./baz baz -rw-rw-r-- 1 bishop bishop 0 Feb 12 00:00 ./bar bar -rw-rw-r-- 1 bishop bishop 0 Jun 17 2015 ./foo foo
For completeness, I will highlight a point with comments on the question: -t sorts by modification time, which is not a strict creation time. The file system on which these files are located dictates whether the creation time is available. Since your initial attempts were made using -t , I figured the modification time was what you were worried about, even if that wasn't pedantic.
If you want to create a time, you will have to pull it from some source, for example, stat or the file name if it is encoded there. This basically means replacing xargs -0 ls -t with a suitable command with sort number, for example: xargs -0 stat -c '%W' | sort -n xargs -0 stat -c '%W' | sort -n
source share