Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Dec 1 '11 at 4:41

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

add comment

1 Answer 1

Use d option of ls.

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

Your Answer

 
discard

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.