touch 명령어를 통해서 atime, ctime 변경이 가능하다.
-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time
# 2011년 01월11일 20시00분에 index 파일생성
[root@chonnom root]# touch -t 1101112000 index.html
[root@chonnom rootl]# stat index.html File: `index.html' Size: 4 Blocks: 8 IO Block: 16384 일반 파일 Device: 13h/19d Inode: 4415152 Links: 1 Access: (0666/-rw-rw-rw-) Uid: ( 1128/ UNKNOWN) Gid: ( 1000/ UNKNOWN) Access: 2011-01-11 20:00:00.000000000 +0900 Modify: 2011-01-11 20:00:00.000000000 +0900 Change: 2011-02-28 13:53:19.000000000 +0900 |
File and directory timestamps in Unix
Three times tracked for each file in Unix are these:
- access time - atime : 파일을 열거나 접근한 시간
- change time – ctime : 파일의 정보가 변경된 시간 (속성이나 퍼미션 변경)
- modify time – mtime : 파일의 내용이 변경된시간
# atime 시간확인
[root@chonnom root]# ls -lu
-rw-rw-rw- 1 1128 1000 0 11월 11 11:11 index.html
# ctime 시간확인
[root@chonnom root]# ls -lc
-rw-rw-rw- 1 1128 1000 0 2월 28 13:27 index.html
# mtime 시간확인
[root@chonnom root]# ls -l -rw-rw-rw- 1 1128 1000 0 11월 11 11:11 index.html
# 세가지 속성시간을 한꺼번에 확인
[root@chonnom root]# stat index.html File: `index.html' Size: 0 Blocks: 0 IO Block: 16384 일반 빈 파일 Device: 13h/19d Inode: 4398943 Links: 1 Access: (0666/-rw-rw-rw-) Uid: ( 1128/ UNKNOWN) Gid: ( 1000/ UNKNOWN) Access: 2010-11-11 11:11:00.000000000 +0900 Modify: 2010-11-11 11:11:00.000000000 +0900 Change: 2011-02-28 13:27:35.000000000 +0900 |