How do I list all the files in a directory and subdirectories in reverse chronological order?

dan picture dan · Feb 5, 2011 · Viewed 241.1k times · Source

I want to do something like ls -t but also have the files in subdirectories included. But the problem is that I don't want the output formated like ls -R does, which is like this:

[test]$ ls -Rt
b       testdir test

./testdir:
a

I want it to be formatted like the find command displays files in subdirectories. I.e:

[test]$ find .
.
./b
./test
./testdir
./testdir/a

But what find doesn't seem to do is order the result chronologically by last update time.

So how can I list all the files in a directory and subdirectories, in the format that find does, but in reverse chronological order?

Answer

rashmi picture rashmi · Nov 26, 2012

ls -lR is to display all files, directories and sub directories of the current directory ls -lR | more is used to show all the files in a flow.