The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command to get File Timestamp including seconds [Aix 5.3] firdousamir Shell Programming and Scripting 8 05-08-2009 08:43 AM
Changing Creation Date to a Prespecified Date of a File In Unix monkfan UNIX for Dummies Questions & Answers 4 11-28-2006 07:15 AM
Displaying file names before a particular creation date dhruv_saksena UNIX for Dummies Questions & Answers 1 09-02-2005 08:19 AM
file creation date & time alisevA3 UNIX for Dummies Questions & Answers 3 07-08-2005 05:21 AM
Converting the File Creation Date to a new format barney_clough UNIX for Dummies Questions & Answers 1 06-12-2002 07:43 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-22-2002
krishna krishna is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 60
file creation date including seconds

Hi,

Is anybody can help me to get the file creation date with seconds?

-rw-r--r-- 1 opsc system 422550845 Aug 22 15:41 StatData.20020821

Thanks in advance

Krishna
  #2 (permalink)  
Old 08-22-2002
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
I don't know of any contemporary Unix filesystem that stores creation date/time at all.

Just modification time...
  #3 (permalink)  
Old 08-22-2002
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
  
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
an extention to LiveinFree's post.

as my perl book says the filessystem keeps the following times:
last asscess time, last modification time, last inode-change time.

you can get this info by useing stat.

man stat for more info.
  #4 (permalink)  
Old 08-22-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
I do notice that your filename already has a datestamp on it....you could look at getting the datestamp that is used to create the file changed to include the seconds as well...

i.e.

filename=StatData\.`date +%Y%m%d%M%H%S`

It probably is currently set at (assuming it is scripted to set the date stamp on the file at the time of creation).

filename=StatData\.`date +%Y%m%d%`
  #5 (permalink)  
Old 08-25-2002
krishna krishna is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 60
Sorry, I'm asking about file date&time below file date&time = Aug 22 15:41, here i will find only hh:mm, my question is how to see hh:mm:ss??????


-rw-r--r-- 1 opsc system 422550845 Aug 22 15:41 StatData.200208


Quote:
Originally posted by peter.herlihy
I do notice that your filename already has a datestamp on it....you could look at getting the datestamp that is used to create the file changed to include the seconds as well...

i.e.

filename=StatData\.`date +%Y%m%d%M%H%S`

It probably is currently set at (assuming it is scripted to set the date stamp on the file at the time of creation).

filename=StatData\.`date +%Y%m%d%`
  #6 (permalink)  
Old 08-26-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
I see.... well in terms of creation date - the answer is you can't - it is not held at all. (Hence my suggestion about having the filenames changed to include the seconds).

If you're after the seconds for last modified - or last accessed....you might be able to do it if you can decipher this from the man page for ls (although that might only be for old files??)

Quote:
-l List in long format, giving mode, ACL indication,
number of links, owner, group, size in bytes, and time
of last modification for each file (see above). If the
file is a special file, the size field instead contains
the major and minor device numbers. If the time of
last modification is greater than six months ago, it is
shown in the format `month date year' for the POSIX
locale. When the LC_TIME locale category is not set to
the POSIX locale, a different format of the time field
may be used. Files modified within six months show
`month date time'.
  #7 (permalink)  
Old 08-26-2002
krishna krishna is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 60
i tried from ls command, but could not get the seconds.

thanks
Krishna
Closed Thread

Bookmarks

Tags
unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0