or now, with
Try using head or tail. If you want the 5 most-recently modified files: ls -1t | head - 5. The -1 (that's a one) says one file per line and the head says ...
Thanks a lot. I initially wanted to list files by date modified. But, you went even further and explained how to reverse the order. This seemed to ...
Try this one: #!/bin/bash find $1 -type f -exec stat --format '%Y :%y %n' "{}" \; | sort - nr | cut -d: -f2- | head. Execute it with the path to the directory ...
To reverse the order, click the up arrow Up arrow or down ...
How do I show last downloaded file first using the ls command?
Learn how to find files that have been changed recently in Linux.
1 Answer · -l List in long format. · -r Reverse the order of the sort to get reverse lexicographical order or the oldest entries first (or largest files last, if combined with ...
If the First one didn't work(that worked for me) you can try the second-one. There's an additional parameter default-sort-in-reverse-order that ...
One solution is: find . -type f -mtime 90. That finds files that was last modified 90 days ago (in those 24 hours that started 91 x 24 hours ago and ended 90 x 24 ...