|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 167 article |
2002-07-06 06:18:06 |
|
|
|
|
NickName |
Ç®ºñ´© |
Subject |
Unix's Timestamp |
|
|
http://linux.co.kr/tips/content.html?
do=showall&msg_id=324&order=desc&cur_page=3&keyword=&search_option=
Title : Unix's Timestamp
ÁöÇö¸í, 2002/04/07
¢º À¯´Ð½ºÀÇ ¼¼°¡Áö ½Ã°£ ±âº» °³³ä
-atime : File was last accessed(´Ü¼øÇÑ ¿¶÷)
-ctime : File's status was last changed(chmod, chown, touch ...)
-mtime : File's data was last modified(ÈÀÏÀÇ µ¥ÀÌÅÍ°¡ ¼öÁ¤µÊ)
(ÈÀÏÀÇ ³»¿ëÀ» ¼öÁ¤Çϸé ctime°ú mtimeÀÌ µ¿ÀÏÇÏ°Ô ¹Ù²ï´Ù.)
¢º ls¿¡¼ ½Ã°£È®ÀÎ
-no_option : -mtime
e.g.) #ls -al --full-time filename
(-m¿É¼ÇÀÌ -mtimeÀÌ ¾Æ´Ñ °ÍÀº default ¿É¼ÇÀ¸·Î µÇ¾î Àֱ⶧¹®¿¡)
-c with -lt : sort by, and show, ctime
e.g.) #ls -alc --full-time filename
-u with -lt : sort by, and show, atime
e.g.) #ls -alu --full-time filename
(-u¿É¼ÇÀº useÀÇ ¶æÀÌ ´ã±äµí, -a¿É¼ÇÀÌ ÀÌ¹Ì »ç¿ëµÇ°í ÀÖ¾î¼)
¢Ä ½ÇÀü¿¹Á¦ ¢Å
// ¿¹Á¦ÈÀÏ »ý¼º
[ gwise@ns work]$ touch timetest
// ±âº»½Ã°£ È®ÀÎ
[ gwise@ns work]$ ls -al --full-time timetest |tr -s " " <- mtime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 12:28:09 2002 timetest
[ gwise@ns work]$ ls -alc --full-time timetest |tr -s " " <- ctime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 12:28:09 2002 timetest
[ gwise@ns work]$ ls -alu --full-time timetest |tr -s " " <- atime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 12:28:09 2002 timetest
// ctimeÀÇ º¯°æ ¿¹Á¦
[ gwise@ns work]$ chmod 777 timetest
[ gwise@ns work]$ ls -al --full-time timetest |tr -s " " <- mtime
-rwxrwxrwx 1 gwise gwise 0 ÀÏ 4¿ù 07 12:28:09 2002 timetest*
[ gwise@ns work]$ ls -alc --full-time timetest |tr -s " " <- ctime
-rwxrwxrwx 1 gwise gwise 0 ÀÏ 4¿ù 07 12:34:48 2002 timetest*
[ gwise@ns work]$ ls -alu --full-time timetest |tr -s " " <- atime
-rwxrwxrwx 1 gwise gwise 0 ÀÏ 4¿ù 07 12:28:09 2002 timetest*
// mtimeÀÇ º¯°æ ¿¹Á¦(ctimeµµ °°ÀÌ º¯ÇÔ)
[ gwise@ns work]$ echo "abc" >> timetest
[ gwise@ns work]$ ls -al --full-time timetest |tr -s " " <- mtime
-rwxrwxrwx 1 gwise gwise 4 ÀÏ 4¿ù 07 12:37:47 2002 timetest*
[ gwise@ns work]$ ls -alc --full-time timetest |tr -s " " <- ctime
-rwxrwxrwx 1 gwise gwise 4 ÀÏ 4¿ù 07 12:37:47 2002 timetest*
[ gwise@ns work]$ ls -alu --full-time timetest |tr -s " " <- atime
-rwxrwxrwx 1 gwise gwise 4 ÀÏ 4¿ù 07 12:28:09 2002 timetest*
¢º touch¸¦ ÅëÇÑ ½Ã°£ º¯°æ
Çü½Ä) -t [[CC]YY]MMDDhhmm[.ss]
¢Ñ touch¸¦ ½ÇÇàÇÏ´Â ¼ø°£ ctimeÀÌ ÇöÀç ½Ã°£À¸·Î ¹Ù²ñ
-no_option : mtime°ú atime µ¿½Ã¿¡ º¯°æ
e.g.) #touch -t 200204071200.00 timetest
-a : change only the access time
e.g.) #touch -a -t 200204071200.00 timetest
-m : change only the modification time
e.g.) #touch -m -t 200204071200.00 timetest
¢Ä ½ÇÀü¿¹Á¦ ¢Å
// ¿¹Á¦ÈÀÏ »ý¼º
[ gwise@ns work]$ touch timetest
// ±âº»½Ã°£ È®ÀÎ
[ gwise@ns work]$ ls -al --full-time timetest |tr -s " " <- mtime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 13:15:58 2002 timetest
[ gwise@ns work]$ ls -alc --full-time timetest |tr -s " " <- ctime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 13:15:58 2002 timetest
[ gwise@ns work]$ ls -alu --full-time timetest |tr -s " " <- atime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 13:15:58 2002 timetest
// -no_option
[ gwise@ns work]$ touch -t 200204071200.00 timetest
[ gwise@ns work]$ ls -al --full-time timetest |tr -s " " <- mtime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 12:00:00 2002 timetest
[ gwise@ns work]$ ls -alc --full-time timetest |tr -s " " <- ctime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 13:20:34 2002 timetest
[ gwise@ns work]$ ls -alu --full-time timetest |tr -s " " <- atime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 12:00:00 2002 timetest
// -a
[ gwise@ns work]$ touch -a -t 200204071300.00 timetest
[ gwise@ns work]$ ls -al --full-time timetest |tr -s " " <- mtime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 12:00:00 2002 timetest
[ gwise@ns work]$ ls -alc --full-time timetest |tr -s " " <- ctime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 13:22:38 2002 timetest
[ gwise@ns work]$ ls -alu --full-time timetest |tr -s " " <- atime
-rw-r--r-- 1 gwise gwise 0 ±Ý 4¿ù 07 13:00:00 2002 timetest
// -m
[ gwise@ns work]$ touch -m -t 200204071313.00 timetest
[ gwise@ns work]$ ls -al --full-time timetest |tr -s " " <- mtime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 13:13:00 2002 timetest
[ gwise@ns work]$ ls -alc --full-time timetest |tr -s " " <- ctime
-rw-r--r-- 1 gwise gwise 0 ÀÏ 4¿ù 07 13:23:52 2002 timetest
[ gwise@ns work]$ ls -alu --full-time timetest |tr -s " " <- atime
-rw-r--r-- 1 gwise gwise 0 ±Ý 4¿ù 07 13:00:00 2000 timetest
¢Ä Á¤ ¸® ¢Å
1. ÈÀÏÀÇ ³»¿ëÀ» ¼öÁ¤Çϸé mtime/ctime ÀÌ ¹Ù²ñ
2. touch¸¦ ÅëÇؼ mtime°ú atimeÀ» º¯°æÇϸé
ctimeÀº ÇöÀç½Ã°£À¸·Î ¹Ù²ñ
3. lsÀÇ default timeÀº mtimeÀÌ´Ù.
|
|
Page Loading [ 0.03 Sec ]
SQL Time [ 0 Sec ]
|
|
|