Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Yea GNU find does help. But OP works on AIX machines so GNU find wasn't available to him. Commented Jan 18, 2012 at 7:52
  • It's too bad ls can't be made to accumulate files before sorting. ls is so fast compared to find. Commented Jan 27, 2016 at 21:53
  • ls and find reads the same data, so I can't imagine any reason ls should be considerably faster than find. On my system find is 5 times faster (searching through roughly half a million files) Commented Jan 27, 2016 at 22:01
  • 11
    You might want a full date/time and not only the file name but also the path in the output, in that case, modify the formatting string: find . -type f -printf "%T@ %Tc %p\n" | sort -n > out.txt yielding output entries like 1427913836.2330520210 wed 1 apr 2015 20:43:56 ./subdir/file.txt. Commented Feb 3, 2016 at 23:08
  • Great. That really helped me out. I've been looking for a way to sort into subdirectories for ages! Commented Apr 9, 2018 at 1:14