View previous topic :: View next topic |
Author |
Message |
bludger Guru
Joined: 09 Apr 2003 Posts: 389
|
Posted: Tue Jun 05, 2007 11:26 am Post subject: Recursive file list sorted by date |
|
|
I have long been looking for a way to recursively list the files in a directory and sort by date. ls -lR lists files recursively, but does not enable sorting by date. Here is a solution that I just found using find:
Code: | LC_TIME=en_DK.UTF-8 find . -type f -printf '%Tx %TX %p\n'|sort |
The locale setting formats the date as YYYY-MM-DD. |
|
Back to top |
|
|
bludger Guru
Joined: 09 Apr 2003 Posts: 389
|
Posted: Tue Jun 05, 2007 11:45 am Post subject: |
|
|
If you don't have the en_DK locale installed, you can manually format the date as follows:
Code: | find . -type f -printf '%TY-%Tm-%Td %TH:%TM:%TS %p\n'|sort |
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|