LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   File creation date (https://www.linuxquestions.org/questions/linux-newbie-8/file-creation-date-630463/)

Jay5487 03-25-2008 07:20 AM

File creation date
 
So I have been reading a bit on being able to get the creation date from a file to be printed... I know you can get all this info from ls -l but I was wondering if it was possible to get the YY/MM/DD out of this....

If the creation date is not possible can you get last modification date YY/MM/DD???

I have a feeling it is not really possible from what i read just wondering if any of you guys have the inside edge to somehting

colucix 03-25-2008 07:36 AM

Code:

ls -l --time-style=+%y/%m/%d | gawk '{print $6}'
or
Code:

date -d "$(stat -c %y file)" +%y/%m/%d
Please note that you can't get the creation date, since this information is not stored in Unix filesystem. You can get last modification or last access time, anyway.

Jay5487 03-25-2008 07:47 AM

Thank you!!! I had actually just found out too! but your way is less code!


All times are GMT -5. The time now is 03:25 AM.