Ö¸µ¼ÔõÑùÉó²é Linux ÎļþµÄʱ¼ä
Linux Îļþʱ¼äÉó²éÖ¸ÄÏ
ÔÚLinux²Ù×÷ϵͳÖУ¬Ã¿¸öÎļþºÍĿ¼¶¼ÓÐÆäÓµÓÐÕß¡¢È¨ÏÞÒÔʵʱ¼ä´ÁµÈÊôÐÔ¡£ÆäÖУ¬Ê±¼ä´Á°üÀ¨Èý¸ö²¿·Ö£º»á¼ûʱ¼ä£¨atime£©¡¢ÐÞ¸Äʱ¼ä£¨mtime£©ºÍ¸Ä±äʱ¼ä£¨ctime£©¡£ÕâЩʱ¼ä´Á¼Í¼ÁËÎļþµÄÏà¹Ø²Ù×÷ʱ¼ä£¬¹ØÓÚϵͳÖÎÀíÔ±ºÍ¿ª·¢Ö°Ô±À´Ëµ£¬ÏàʶÎļþµÄʱ¼ä´ÁÐÅÏ¢¿ÉÒÔ×ÊÖúËûÃǸüºÃµØÖÎÀíÎļþºÍ×·×ÙÎļþµÄת±ä¡£±¾Ö¸ÄϽ«ÏÈÈÝÔõÑùͨ¹ýÏÂÁîÉó²éÎļþµÄʱ¼ä´Á£¬²¢ÌṩÏìÓ¦µÄ´úÂëʾÀý¡£
Éó²é»á¼ûʱ¼ä£¨atime£©£º
»á¼ûʱ¼äÖ¸µÄÊÇÎļþ×î½üÒ»´Î±»»á¼ûµÄʱ¼ä¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²éÎļþµÄ»á¼ûʱ¼ä£º
stat <ÎļþÃû>
µÇ¼ºó¸´ÖÆ
ʾÀý£º
stat test.txt
µÇ¼ºó¸´ÖÆ
Éó²éÐÞ¸Äʱ¼ä£¨mtime£©£º
ÐÞ¸Äʱ¼äÖ¸µÄÊÇÎļþÄÚÈÝ×î½üÒ»´Î±»Ð޸ĵÄʱ¼ä¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²éÎļþµÄÐÞ¸Äʱ¼ä£º
stat -c %y <ÎļþÃû>
µÇ¼ºó¸´ÖÆ
ʾÀý£º
stat -c %y test.txt
µÇ¼ºó¸´ÖÆ
Éó²é¸Ä±äʱ¼ä£¨ctime£©£º
¸Ä±äʱ¼äÖ¸µÄÊÇÎļþµÄinodeÔªÊý¾Ý×î½üÒ»´Î±»Ð޸ĵÄʱ¼ä¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²éÎļþµÄ¸Ä±äʱ¼ä£º
stat -c %z <ÎļþÃû>
µÇ¼ºó¸´ÖÆ
ʾÀý£º
stat -c %z test.txt
µÇ¼ºó¸´ÖÆ
ʹÓÃlsÏÂÁîÉó²éÎļþʱ¼ä´Á£º
lsÏÂÁîÒ²¿ÉÒÔÉó²éÎļþµÄʱ¼ä´ÁÐÅÏ¢£¬Ê¹ÓÃ-l²ÎÊý¿ÉÒÔÏÔʾ¸üÏêϸµÄʱ¼ä´ÁÐÅÏ¢¡£ÒÔÏÂÊÇlsÏÂÁîÉó²éÎļþʱ¼ä´ÁµÄʾÀý£º
ls -l <ÎļþÃû>
µÇ¼ºó¸´ÖÆ
ʾÀý£º
ls -l test.txt
µÇ¼ºó¸´ÖÆ
ͨ¹ýÉÏÊöÏÂÁîºÍʾÀý£¬ÎÒÃÇ¿ÉÒÔÀû±ãµØÉó²éÎļþµÄ»á¼ûʱ¼ä¡¢ÐÞ¸Äʱ¼äºÍ¸Ä±äʱ¼ä£¬´Ó¶ø¸üºÃµØÖÎÀíÎļþºÍ×·×ÙÎļþµÄת±ä¡£Ï£Íû±¾Ö¸Ä϶ÔÄúÓÐËù×ÊÖú£¡
ÒÔÉϾÍÊÇÖ¸µ¼ÔõÑùÉó²é Linux ÎļþµÄʱ¼äµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡