I have the following folder setup for example
A/file1.txt B/file2.txt B/file3.txt . . . NN/file100.txt
I need to recursively list them with file size, modification time and sorted by modification time recent first.
I have tried the below without size… Any pointers?
find . -printf "%Tc file* n" | sort -n
Advertisement
Answer
find . -name <pattern> -printf "%T+t%st%pn" | sort
- %T+ – modification time (and date)
- %s – size
- %p – path of file