I want to extract creation date of a file and modification time. The format should be (yyyymmddhh24miss
).
- My unix shell
/usr/bin/ksh
- The file:
file.txt
- My system: SunOS 5.10 Generic_150400-23 sun4v sparc sun4v
I want to extract creation date of a file and modification time. The format should be (yyyymmddhh24miss
).
/usr/bin/ksh
file.txt
I have found the solution:
perl -MPOSIX -l -e \
'print strftime "%Y%m%d%H%M%S", localtime((lstat)[9]) for @ARGV' file.txt