Desired Date format

I need to get the current year for the files that has been created today.
Ex-

when i list in unix console it shows

ls -l abc.txt
-rw-rw-r--    1 user1 user1  33 May  2 08:58 abc.txt

but i need to get as May 2 2013 , i dont need 08:58 is there any command to list it out in that way..?

Thanks in Advance.

try ls -e

ls -l --time-style="+%Y-%m-%d"

What OS are you using?

ls -e not working

Im using AIX.

I dont see any direct command which can do that on AIX. I guess you have to modify the ls -l output as per your requirements.

Here's a perl. Kinda heavy.. but does the job.

perl -MPOSIX -e 'print strftime("%b %d, %Y",localtime((stat("/path/to/file.txt"))[9]))'

Worst case :slight_smile:

 
ls -lrt|sed 's/..:../'`date +%Y`'/g'