Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
find date format
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
bludger
Guru
Guru


Joined: 09 Apr 2003
Posts: 389

PostPosted: Wed Feb 27, 2008 9:21 am    Post subject: find date format Reply with quote

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
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Thu Feb 28, 2008 2:28 am    Post subject: Reply with quote

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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Thu Feb 28, 2008 3:51 am    Post subject: Reply with quote

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
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Thu Feb 28, 2008 4:28 am    Post subject: Reply with quote

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 :oops:

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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Thu Feb 28, 2008 7:32 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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