linuxÃüÁîѧϰ±Ê¼Ç£¨9£©£ºtouchÃüÁî
linuxµÄtouchÃüÁî²»³£Óã¬Ò»°ãÔÚʹÓÃmakeµÄʱºò¿ÉÄÜ»áÓõ½£¬ÓÃÀ´ÐÞ¸ÄÎļþʱ¼ä´Á£¬»òÕßн¨Ò»¸ö²»´æÔÚµÄÎļþ¡£
1£®ÃüÁî¸ñʽ£º
touch [Ñ¡Ïî]... Îļþ...
2£®ÃüÁî²ÎÊý£º
-a »ò--time=atime»ò--time=access»ò--time=use ¡¡Ö»¸ü¸Ä´æȡʱ¼ä¡£
-c »ò--no-create ¡¡²»½¨Á¢ÈκÎÎĵµ¡£
-d ¡¡Ê¹ÓÃÖ¸¶¨µÄÈÕÆÚʱ¼ä£¬¶ø·ÇÏÖÔÚµÄʱ¼ä¡£
-f ¡¡´Ë²ÎÊý½«ºöÂÔ²»Óè´¦Àí£¬½ö¸ºÔð½â¾öBSD°æ±¾touchÖ¸ÁîµÄ¼æÈÝÐÔÎÊÌâ¡£
-m »ò--time=mtime»ò--time=modify ¡¡Ö»¸ü¸Ä±ä¶¯Ê±¼ä¡£
-r ¡¡°ÑÖ¸¶¨Îĵµ»òĿ¼µÄÈÕÆÚʱ¼ä£¬Í³Í³Éè³ÉºÍ²Î¿¼Îĵµ»òĿ¼µÄÈÕÆÚʱ¼äÏàͬ¡£
-t ¡¡Ê¹ÓÃÖ¸¶¨µÄÈÕÆÚʱ¼ä£¬¶ø·ÇÏÖÔÚµÄʱ¼ä¡£
3£®ÃüÁÄÜ£º
touchÃüÁî²ÎÊý¿É¸ü¸ÄÎĵµ»òĿ¼µÄÈÕÆÚʱ¼ä£¬°üÀ¨´æȡʱ¼äºÍ¸ü¸Äʱ¼ä¡£
4£®Ê¹Ó÷¶Àý£º
ʵÀýÒ»£º´´½¨²»´æÔÚµÄÎļþ
ÃüÁtouch log2012.log log2013.log
Êä³ö£º
[root@localhost test]# touch log2012.log log2013.log [root@localhost test]# ll -rw-r--r-- 1 root root 0 10-28 16:01 log2012.log -rw-r--r-- 1 root root 0 10-28 16:01 log2013.log
Èç¹ûlog2014.log²»´æÔÚ£¬Ôò²»´´½¨Îļþ
[root@localhost test]# touch -c log2014.log [root@localhost test]# ll -rw-r--r-- 1 root root 0 10-28 16:01 log2012.log -rw-r--r-- 1 root root 0 10-28 16:01 log2013.log
ʵÀý¶þ£º¸üÐÂlog.logµÄʱ¼äºÍlog2012.logʱ¼ä´ÁÏàͬ
ÃüÁtouch -r log.log log2012.log
Êä³ö£º
[root@localhost test]# ll -rw-r--r-- 1 root root 0 10-28 16:01 log2012.log -rw-r--r-- 1 root root 0 10-28 16:01 log2013.log -rw-r--r-- 1 root root 0 10-28 14:48 log.log [root@localhost test]# touch -r log.log log2012.log [root@localhost test]# ll -rw-r--r-- 1 root root 0 10-28 14:48 log2012.log -rw-r--r-- 1 root root 0 10-28 16:01 log2013.log -rw-r--r-- 1 root root 0 10-28 14:48 log.log
ʵÀýÈý£ºÉ趨ÎļþµÄʱ¼ä´Á
ÃüÁtouch -t 201211142234.50 log.log
Êä³ö£º
[root@localhost test]# ll -rw-r--r-- 1 root root 0 10-28 14:48 log2012.log -rw-r--r-- 1 root root 0 10-28 16:01 log2013.log -rw-r--r-- 1 root root 0 10-28 14:48 log.log [root@localhost test]# touch -t 201211142234.50 log.log [root@localhost test]# ll -rw-r--r-- 1 root root 0 10-28 14:48 log2012.log -rw-r--r-- 1 root root 0 10-28 16:01 log2013.log -rw-r--r-- 1 root root 0 2012-11-14 log.log
˵Ã÷£º
-t time ʹÓÃÖ¸¶¨µÄʱ¼äÖµ time ×÷Ϊָ¶¨ÎļþÏàӦʱ¼ä´Á¼ÇµÄÐÂÖµ£®´Ë´¦µÄ time¹æ¶¨ÎªÈçÏÂÐÎʽµÄÊ®½øÖÆÊý:
[[CC]YY]MMDDhhmm[.SS]
ÕâÀCCΪÄêÊýÖеÄÇ°Á½Î»£¬¼´¡±ÊÀ¼ÍÊý¡±£»YYΪÄêÊýµÄºóÁ½Î»£¬¼´Ä³ÊÀ¼ÍÖеÄÄêÊý£®Èç¹û²»¸ø³öCCµÄÖµ£¬Ôòtouch ½«°ÑÄêÊýCCYYÏÞ¶¨ÔÚ1969--2068Ö®ÄÚ£®MMΪÔÂÊý£¬DDΪÌ콫°ÑÄêÊýCCYYÏÞ¶¨ÔÚ1969--2068Ö®ÄÚ£®MMΪÔÂÊý£¬DDΪÌìÊý£¬hh ΪСʱÊý(¼¸µã)£¬mmΪ·ÖÖÓÊý£¬SSΪÃëÊý£®´Ë´¦ÃëµÄÉ趨·¶Î§ÊÇ0--61£¬ÕâÑù¿ÉÒÔ´¦ÀíÈòÃ룮ÕâЩÊý×Ö×é³ÉµÄʱ¼äÊÇ»·¾³±äÁ¿TZÖ¸¶¨µÄʱÇøÖеÄÒ»¸öʱ ¼ä£®ÓÉÓÚϵͳµÄÏÞÖÆ£¬ÔçÓÚ1970Äê1ÔÂ1ÈÕµÄʱ¼äÊÇ´íÎóµÄ¡£
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ