LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 11:55 AM   #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, 12:34 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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, 12: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, 04:58 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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 08:31 AM
cannot stat DAChristen29 Linux - Software 1 05-23-2005 05:54 PM
cannot stat scottsteibel Linux - Newbie 2 12-11-2004 03:51 PM
stat warney_out Programming 1 09-28-2004 03:37 AM
Linux stat to Windows Stat sridurai Programming 3 09-24-2004 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:27 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
Open Source Consulting | Domain Registration