Sunday 23 February 2014

How to change the timestamp of a file

Changing timestamp of a file
===================


server1:/home/sankarar # ls -ltr
total 96
-rwxr-----    1 sankarar itc             254 Apr 02 2011  .profile
-rw-------    1 sankarar itc              10 Apr 02 2011  .forward
-rwxr--r--    1 root     system         3506 Jul 29 07:14 prework.sh
-rw-------    1 sankarar itc             202 Sep 01 20:56 .sh_history
-rw-r--r--    1 root     system        10240 Nov 11 05:05 tes.tar
-rw-r--r--    1 root     system        10240 Nov 11 05:06 fes.tar
-rwxr-xr-x    1 root     system          186 Dec 16 17:59 f1
-rwxr-xr-x    1 root     system          668 Dec 16 18:02 f3


Changing timestamp of file "f1" from "Dec 16 17:59" to "Nov 11 05:05"



server1:/home/sankarar # touch -t 201111110505.05 f1

server1:/home/sankarar # ls -ltr
total 96
-rwxr-----    1 sankarar itc             254 Apr 02 2011  .profile
-rw-------    1 sankarar itc              10 Apr 02 2011  .forward
-rwxr--r--    1 root     system         3506 Jul 29 07:14 prework.sh
-rw-------    1 sankarar itc             202 Sep 01 20:56 .sh_history
-rwxr-xr-x    1 root     system          186 Nov 11 05:05 f1
-rw-r--r--    1 root     system        10240 Nov 11 05:05 tes.tar
-rw-r--r--    1 root     system        10240 Nov 11 05:06 fes.tar
-rwxr-xr-x    1 root     system          668 Dec 16 18:02 f3




[[[CC]YY]MMDDhhmm[.SS]].

201111110505.05

No comments:

Post a Comment