LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Quick bash question

[ILUG] Quick bash question

Justin MacCarthy macarthy at iol.ie
Tue Mar 26 15:40:48 GMT 2002


I want to get a list of the mdate of files in a directory in a "days ago
format"

so if a have a directory


test1 mtime = 20/3/2002
test4 mtime = 21/3/2002
test3 mtime = 21/3/2002
test2 mtime = 22/3/2002

Today I would get a list as such :

6
5
4


I'm aware of the various find /dir -printf "%C" formats
but I can't think of a clever way of getting the "days ago" format.

or do I need to do some math

SecondsFromEpochNow - SecondsFromEpochFilemdate mod (24*60*60)


Justin





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell