Unix: get the file date


ls -1 | cpio -o | cpio -ivt | awk '{print $NF, $(NF-1), $(NF-4), $(NF-3) }'

Warning: I/O expensive for the large files!

Perl:

@a = localtime((stat($my_file))[9]); $a[4]++;
printf "%02d%02d%02d",@a[5,4,3];

One thought on “Unix: get the file date

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.