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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.