Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .