Computing.Net > Forums > Unix > ls date format

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ls date format

Reply to Message Icon

Name: nauj
Date: April 30, 2007 at 06:56:43 Pacific
OS: AIX 5.1
CPU/Ram: IBM
Product: 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



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: April 30, 2007 at 07:17:31 Pacific
Reply:

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.


0

Response Number 2
Name: nauj
Date: April 30, 2007 at 08:05:03 Pacific
Reply:

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


0

Response Number 3
Name: nails
Date: April 30, 2007 at 15:08:02 Pacific
Reply:

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.


0

Response Number 4
Name: doutdes
Date: May 5, 2007 at 00:17:59 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: ls date format

change date format using shell www.computing.net/answers/unix/change-date-format-using-shell/6741.html

Time diff and date formatting prob www.computing.net/answers/unix/time-diff-and-date-formatting-prob/5065.html

Prb in Yest'days Date Format www.computing.net/answers/unix/prb-in-yestdays-date-format/4559.html