0

The main answer of Sort the files in the directory recursively based on last modified date gives a method to list all files in a directory, recursively, sorted by modification date:

find -printf "%TY-%Tm-%Td %TT %p\n" | sort -n

However it doesn't list only the files, but also the directories. How to list only the files?

1

1 Answer 1

3

Tell find you only want files (-type f):

find -type f -printf "%TY-%Tm-%Td %TT %p\n" | sort -n

You must log in to answer this question.

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