Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to sort files by date, including those that reside in subdirectories. I got it to work by using:

find . -exec ls -lrt {} \+

which I found somewhere on StackOverflow. My initial try was to use:

ls -lrt `find .`

but it doesn't work. It sorts the contents of each directory by date, rather than all of them together.

Why do these produce different output?

share|improve this question

migrated from Dec 1 '11 at 4:41

This question came from our site for professional and enthusiast programmers.

Use d option of ls.

ls -lrtd `find .`
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.