Comments on: How to Find and Sort Files Based on Modification Date and Time in Linux https://www.tecmint.com/find-and-sort-files-modification-date-and-time-in-linux/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 17:20:57 +0000 hourly 1 By: michi https://www.tecmint.com/find-and-sort-files-modification-date-and-time-in-linux/comment-page-1/#comment-1904028 Mon, 24 Oct 2022 12:09:44 +0000 http://www.tecmint.com/?p=18325#comment-1904028 Already a few years old, but always stimulating. ;-)

thanks for the site.

]]>
By: Rob https://www.tecmint.com/find-and-sort-files-modification-date-and-time-in-linux/comment-page-1/#comment-1861187 Fri, 12 Aug 2022 13:44:15 +0000 http://www.tecmint.com/?p=18325#comment-1861187 With the find command just more simple is to use the %AF instead of the %AD specifier in -printf. A simple sort -r after the pipe symbol then is sufficient to get it sorted with the most recent file on top. E.g. recursive search on file with a certain suffix:

$ find ~ -iname *.svg -printf "\n%AF %AT %p" | sort -r | head -n 30

Of course, the sort command must be executed before head ;-). Which might take some time.

]]>
By: Roel Van de Paar https://www.tecmint.com/find-and-sort-files-modification-date-and-time-in-linux/comment-page-1/#comment-1597939 Wed, 29 Sep 2021 02:57:26 +0000 http://www.tecmint.com/?p=18325#comment-1597939 Perhaps a better alternative, or more specific/accurate date/time sorting, though I could not (yet) fault the one listed in #5 above. Reasoning about it though, it would not seem to be accurate.

find / -type f -printf "\n%AD %AT %p" | sort -t' ' -k1.7,1.8n -k1.1,1.2n -k1.4,1.5n -k2.1,2.2n -k2.4,2.5n -k2.7,2.8n -k2.10,2.19n

]]>
By: Vivek Sunny https://www.tecmint.com/find-and-sort-files-modification-date-and-time-in-linux/comment-page-1/#comment-1371171 Wed, 07 Oct 2020 03:37:28 +0000 http://www.tecmint.com/?p=18325#comment-1371171 Extremely bad font color used for command, can’t see anything properly.

]]>
By: Prashant Thorat https://www.tecmint.com/find-and-sort-files-modification-date-and-time-in-linux/comment-page-1/#comment-1006986 Wed, 27 Jun 2018 13:56:32 +0000 http://www.tecmint.com/?p=18325#comment-1006986 Hello,

Nice commands, those commands we can use in bash scripting according to requirement.

]]>