LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2008, 12:55 PM   #1
joshnya
Member
 
Registered: Feb 2003
Location: Boston, MA
Distribution: RedHat 9
Posts: 39

Rep: Reputation: 15
stat command


I would like to list out all the file attributes in a direcotry using the stat command (or any other command).

My goal is to recursivily list the:
1) Time of last access
2) Time of last modification
3) Time of last change

Can someone offer a suggestion on how to accomplish this?

Thank you.
 
Old 05-29-2008, 01:34 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531
Reading the manual pages should help: 'find $DIR -print0| xargs -0 -iX stat -c "%Y %X %Z" 'X'' or 'find $DIR -printf "%p/%f %T@ %A@ %C@\n"'.
 
Old 05-29-2008, 01:52 PM   #3
joshnya
Member
 
Registered: Feb 2003
Location: Boston, MA
Distribution: RedHat 9
Posts: 39

Original Poster
Rep: Reputation: 15
Thank you upSpawn

Can you please put this into english and expand what is happening?

find $DIR -printf "%p/%f %T@ %A@ %C@\n"

I've figured out that $DIR = current directory
and I think that \n is new line.

What else is there in that line and how can I find other % operators variables and thier meaning without having to ask you ?

Thanks again!
 
Old 05-30-2008, 05:58 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531
Quote:
Originally Posted by joshnya View Post
how can I find other % operators variables and thier meaning without having to ask you ?
That is the right question! See 'man find', at "-printf format".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stat command output description jackloo Linux - Newbie 2 09-28-2007 09:31 AM
cannot stat DAChristen29 Linux - Software 1 05-23-2005 06:54 PM
cannot stat scottsteibel Linux - Newbie 2 12-11-2004 04:51 PM
stat warney_out Programming 1 09-28-2004 04:37 AM
Linux stat to Windows Stat sridurai Programming 3 09-24-2004 05:07 PM


All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration