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.

2
  • thanks for the answers Gilles - the -t and the -r are actually quite helpful for me in the reports that I create, though. I knew of the -printf switch but never used it so much. I haven't tried to tweak the -printf parameters to produce a clean read out yet. Commented Feb 26, 2016 at 13:52
  • 1
    @Gustav ls -rt doesn't do anything when you pass one file at a time. find … -exec ls -trd {} + would call ls in batches, so it will sort, but only per batch: if there are too many files, ls will be called multiple times and so the output won't be sorted. To get sorted output, your best bet is to use a parseable date format (ideally YYYY-MM-DD HH:MM:SS) and pipe through sort. Or use zsh globbing flags (which requires installing the zsh package). Commented Feb 26, 2016 at 14:03