PDA

View Full Version : List Files & Folders with Creation Dates


Nonsanity
May 6th, 2009, 01:03 AM
I'm looking for some way to quickly (because there are a lot of them) generate a text dump of all the files AND folders in a give directory AND their creation dates (for later sorting).

Anyone have any shortcuts to this end that I've missed?

~ Nonsanity

P.s. This will be an automatic process...

Nonsanity
May 6th, 2009, 01:52 PM
I'm not answering my own question, that was done for me on another forum. But in the interest of keeping other people's future google searches from coming up empty on this thread, I'm posting the answer here too.

stat

The stat command lets you format your own ls-like output. In my case, I went with:

stat -f '%N%t%a%t%B%t%HT' *

Which gives me an output formatted as:

Name (tab) last access time int (tab) creation date int (tab) type string

I can now easily sort this output by any of the columns, and I can remove the non-directories that I don't care about in this case.

Hope it helps someone else too. (Use 'man stat' to get full usage.)

~ Nonsanity