Where developers come to connect, share, build and be inspired.

13

Find recursively and sort by last modified

1305 views

ls has the -t switch, that enables sorting by last modified. However, often we want to find recursively and get to that file that we last edited a year ago. That's fine, since we can do

ls -t $(find .)

We can have more versions of that, too. If we want the full info, we ca change it to

ls -lt $(find .)

Or, if we'd like to look only through directories, we can use

ls -ltd $(find .)

We can even pipe it to view and open the needed files in view!

ls -t $(find .) | view -

Comments

Add a comment