B / Y / U / S
HOME À¥ È£½ºÆà µµ¸ÞÀÎ ¸Å´º¾ó °í°´Áö¿ø ¼³Á¤Á¤º¸ °èÁ¤½Åû 2024-12-27 Friday 
À¥ È£½ºÆÃ
# °øÁö »çÇ×
# ÀÚÁÖ ¹¯´Â Áú¹®
# Áú¹®°ú ´äº¯
# °¡ÀÔ ¹®ÀÇ
Ä¿¹Â´ÏƼ
# ÀÚÀ¯°Ô½ÃÆÇ
# ¸®´ª½ºÆÁ
# ¾ÆÀÌÅ¥ Å×½ºÆ®
# ³»È¨ ¼Ò°³
# °Ö·¯¸®
# ÀÚ·á½Ç

  ¸®´ª½ºÆÁ  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ÀÌ´Ù.
Regist Addr [ 211.110.41.183 ] ¸ñ·Ïº¸±â À­±Û ¾Æ·§±Û
Á¤±ÔÇ¥Çö½Ä [ »ó¼¼ °Ë»ö ]
Page Loading [ 0.03 Sec ] SQL Time [ 0 Sec ]

Copyleft 1999-2024 by JSBoard Open Project
Theme Designed by IDOO And follow GPL2

°³ÀÎÁ¤º¸ Ãë±Þ¹æħ ÀÌ¿ë ¾à°ü »çÀÌÆ® ¸Ê ¾îµå¹Î °ü¸®