Show both ctime and atime in ls output
Solution 1:
You could run stat -c '%x %z' filename.txt
Solution 2:
If you are only parsing values out of ls
, you can use stat
instead:
# stat -c %x,%z,%n * 2011-01-11 06:09:04.000000000 -0500,2011-01-11 02:43:52.000000000 -0500,sqlupdate.sh 2011-01-11 06:09:04.000000000 -0500,2011-01-12 02:43:55.000000000 -0500,file.tar.gz 2011-01-11 06:09:04.000000000 -0500,2011-01-11 02:43:52.000000000 -0500,mysql_password.txt 2011-01-17 02:43:49.000000000 -0500,2011-01-12 13:40:48.000000000 -0500,public_html
Where:
%x Time of last access %z Time of last change %n Name of file