Computing.Net > Forums > Unix > ls date format

ls date format

Reply to Message Icon

Original Message
Name: nauj
Date: April 30, 2007 at 06:56:43 Pacific
Subject: ls date format
OS: AIX 5.1
CPU/Ram: IBM
Model/Manufacturer: IBM
Comment:

I want to get the modification date of a file in a AIX system, but in a date-time format, for example
(dd/mm/yyyy hh:mm:ss) (SECONDS included)

When I make an ls -la, I get this:

hacsvc08:/home/grpa/dwb/DWBANTE/IN > ls -la *D070120*
-rwxrwx--- 1 vadwb gadwb 75 25 abr 13:42 CONTADOR.ENT.D070120

I want to know the date 25 abr 13:42 with seconds that is:
25 abr 13:42:XX

is that possible??

Any advice will be greatly apreciatted

Thanks in advance


Report Offensive Message For Removal


Response Number 1
Name: ghostdog
Date: April 30, 2007 at 07:17:31 Pacific
Subject: ls date format
Reply: (edit)

Do you have Perl in your system?
if have, you can do
#perldoc -f stat
and it shows you how to get time info from a file.


Report Offensive Follow Up For Removal

Response Number 2
Name: nauj
Date: April 30, 2007 at 08:05:03 Pacific
Subject: ls date format
Reply: (edit)

Thanks for your help, unfortunately i don't have Perl in my system, do you know any other way??

Any advice will be greatly aprecitted


Report Offensive Follow Up For Removal

Response Number 3
Name: nails
Date: April 30, 2007 at 15:08:02 Pacific
Subject: ls date format
Reply: (edit)

Too bad you can't take ghostdog's perl suggestion. The problem with the classic long listing of the ls command is that the structure changes after the file is 6 months old.

Consider this miscellaneous unix tips column:

http://www.unixreview.com/documents...

The third tip discusses using year instead of time in the ls command. Perhaps you can modify it to suit your needs.


Report Offensive Follow Up For Removal

Response Number 4
Name: doutdes
Date: May 5, 2007 at 00:17:59 Pacific
Subject: ls date format
Reply: (edit)

there is a ls from gnu that brings a more detailed date
it's worth a try
http://www.gnu.org/software/fileutils/


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: ls date format

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge