Find recursively and sort by last modified
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 -
Written by Ivan Zarea
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#