View previous topic :: View next topic |
Author |
Message |
bludger Guru
Joined: 09 Apr 2003 Posts: 389
|
Posted: Wed Feb 27, 2008 9:21 am Post subject: find date format |
|
|
I usually use the following gnu find parameters to print out the date. This allows me to easily sort by date.
Code: | find . -type f -printf '%TY-%Tm-%Td %TH:%TM:%TS %u %g %m %p\n'|sort |
This used to result in the following output:
Code: | 2008-02-27 09:16:14 bludger users 755 ./<filename> |
On a more recently updated system, however, the same command produces the following:
Code: | 2008-02-27 00:15:22.0000000000 bludger users 644 ./<filename> |
I don't want to see fractional seconds. What has changed here, what can I do to fix it? _________________ Modolingo - International Language Center
Quality Language School for Business and General English, German and all living languages.
Munich and Germany wide. |
|
Back to top |
|
|
coolsnowmen Veteran
Joined: 30 Jun 2004 Posts: 1479 Location: No.VA
|
Posted: Thu Feb 28, 2008 2:28 am Post subject: |
|
|
Did some testing for you.
this appears to be a bug/change in findutils in attempts to gain nano second granularity
You can submit a bug to them, but you will need to download to get your desired result
sys-apps/findutils-4.2.31
worked for me _________________ emerge: there are no ebuilds to satisfy "moo" |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Feb 28, 2008 3:51 am Post subject: |
|
|
Code: | find . -type f -printf '%TY-%Tm-%Td %TH:%TM:%TS %u %g %m %p\n' | sort | sed -e 's/\.[0-9]\{10,10\}//'
find . -type f -printf '%TF %TT %u %g %m %p\n' | sort | sed -e 's/\.[0-9]\{10,10\}//' |
|
|
Back to top |
|
|
coolsnowmen Veteran
Joined: 30 Jun 2004 Posts: 1479 Location: No.VA
|
Posted: Thu Feb 28, 2008 4:28 am Post subject: |
|
|
coolsnowmen wrote: | but you will need to download to get your desired result
worked for me |
So apparently need was too strong of a word
i really do think findutils should provide both
as even the %TT now doesn't match their documentation and, IMHO, seconds with out decimal places is more useful., I wonder if it has to do with some change in strftime and the findutils maintainers like it that way. _________________ emerge: there are no ebuilds to satisfy "moo" |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Feb 28, 2008 7:32 am Post subject: |
|
|
coolsnowmen wrote: | i really do think findutils should provide both | Agreed, at least documented options should function as they are documented to.
Moved from Unsupported Software to Other Things Gentoo. |
|
Back to top |
|
|
|