How can i generate a list of files in a directory [e.g.: "/mnt/hdd/PUB/"] ordered by the files modification time? [in descending order, the oldest modified file is at the lists end]
ls -A -lRt would be great: https://pastebin.com/raw.php?i=AzuSVmrJ
but if a file is changed in a directory it lists the full directory...so the pastebined link isn't good [i don't want a list ordered by "directories", i need a "per file" ordered list]
os: openwrt..[no perl -> not enough space for it :( + no "stat", or "file" command]
Thank you!
| |||
|
feedback
|
|
Use find and sort:
the long list of k options after sort define the year, month, day, hour and minute as sort keys and order by them in that order. Files saved on the same minute won't get ordered. If you want to go down to seconds and more, add "--full-time" to the ls command, and add new keys at the end of the sort command. | |||||
feedback
|
|
Here's an ugly answer that partially works for me in cygwin:
| |||||||
feedback
|
|
"Changing" the file in the directory may well update the directory's modification time. But if you are not interested in the directories, grep them out:
| |||
|
feedback
|
findhave-printf? By the way, don't forget to mark answers as accepted when you can and upvote as often as you can. – Dennis Williamson Feb 28 '11 at 16:42