Operating System - HP-UX
1827435 Members
5158 Online
109965 Solutions
New Discussion

Re: How to find the YEAR of the File Created?

 
redhat7012
Advisor

How to find the YEAR of the File Created ?

Hi,

 

# ls -lrt|more
-rw-r--r--    1 root     system       599751 Sep 12 12:32 1209121159_wsmncp01.log
-rw-r--r--    1 root     system       602065 Sep 12 18:29 1209121759_wsmncp01.log
-rw-r--r--    1 root     system       600927 Sep 13 00:24 1209122359_wsmncp01.log
-rw-r--r--    1 root     system       582738 Sep 13 01:15 1309120059_wsmncp01.log
-rw-r--r--    1 root     system       589388 Sep 13 06:18 1309120559_wsmncp01.log
-rw-r--r--    1 root     system       598967 Sep 13 12:30 1309121159_wsmncp01.log
-rw-r--r--    1 root     system       600927 Sep 13 18:24 1309121759_wsmncp01.log
-rw-r--r--    1 root     system       602457 Sep 14 00:34 1309122359_wsmncp01.log
-rw-r--r--    1 root     system       582883 Sep 14 01:18 1409120059_wsmncp01.log
-rw-r--r--    1 root     system       588851 Sep 14 06:20 1409120559_wsmncp01.log
-rw-r--r--    1 root     system       599359 Sep 14 12:30 1409121159_wsmncp01.log
-rw-r--r--    1 root     system       602065 Sep 14 18:27 1409121759_wsmncp01.log

 

These files shows only the Month and Date of the file created....But not the Year .

 

Can anybody knows ,How to find the YEAR also along with the Month and date  and time ?

 

#ls -l only shows Month and date but not year.

 

 

Regards,

Aparna.

 

 

P.S. This thread has been moved from HP-UX > System Administration to HP-UX > languages - HP Forums Moderator

 

 

 

2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: How to find the YEAR of the File Created ?

Files less than a year old show a time stamp.

 

Files with a time stamp can be assumed to be THIS year.

 

if you look at the man page for ls you can get it to display year on all files.

 

Try this:

 

ls -larte

 

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: How to find the YEAR of the File Created?

You can't find when created, only modified, access or inode changed.

 

But if you want to fiddle with the ls output format, consult the tag cloud:

http://h30499.www3.hp.com/t5/tag/ls.cat/tg-p

http://h30499.www3.hp.com/t5/Languages-and-Scripting/Scripting-Question-date-related/m-p/5750811#M44382