get file timestamp
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > get file timestamp




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    get file timestamp  
bill


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-08-05 11:29 PM

Anyway to grab a file's timestamp (date, time, seconds) using straight
Unix Shell commands or ksh bultin?  (not GNU, not perl, not C)






[ Post a follow-up to this message ]



    Re: get file timestamp  
Bit Twister


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-08-05 11:29 PM

On 8 Nov 2005 09:44:14 -0800, bill wrote:
> Anyway to grab a file's timestamp (date, time, seconds) using straight

man stat





[ Post a follow-up to this message ]



    Re: get file timestamp  
Jordan Abel


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-08-05 11:29 PM

On 2005-11-08, bill <quitspam@hotmail.com> wrote:
> Anyway to grab a file's timestamp (date, time, seconds) using straight
> Unix Shell commands or ksh bultin?  (not GNU, not perl, not C)

ls(1) -- or stat(1), less friendly but will give you all three
timestamps in unix epoch format.





[ Post a follow-up to this message ]



    Re: get file timestamp  
Gordon Burditt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-08-05 11:29 PM

>Anyway to grab a file's timestamp (date, time, seconds) using straight
>Unix Shell commands or ksh bultin?  (not GNU, not perl, not C)

Yes.  If you don't need the time down to the second, you can parse
the output of "ls -l".  Otherwise you can use the BSD program "stat",
if you consider that standard enough.  You can get any time format
strftime() will give to you.

% stat -f "%Sm" .
Nov  8 00:59:08 2005
% stat -f "%Sm" -t "%Y%m%d%H%M%S" .
20051108005908
%

Instead of m (modification time), you can use a (access time) or
c (inode change time).


Gordon L. Burditt





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:36 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register