×ðÁú¿­Ê±¹ÙÍøµÇ¼

³£ÓÃµÄ Linux Îļþʱ¼äÉó²é²Ù×÷

ÔÚ Linux ϵͳÖУ¬Éó²éÎļþµÄʱ¼äÐÅÏ¢ÊÇ¿ª·¢Õß¡¢ÏµÍ³ÖÎÀíÔ±ÉõÖÁͨË×Óû§¾­³£ÐèÒª¾ÙÐеIJÙ×÷Ö®Ò»¡£Îļþʱ¼äÐÅÏ¢Ö÷Òª°üÀ¨ÈýÖÖ£º»á¼ûʱ¼ä£¨atime£©¡¢ÐÞ¸Äʱ¼ä£¨mtime£©ºÍ¸ü¸Äʱ¼ä£¨ctime£©¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«ÏÈÈÝÔÚ Linux ÖÐÔõÑùͨ¹ýÏÂÁîÐлñÈ¡ÎļþµÄʱ¼äÐÅÏ¢£¬²¢¸½ÉÏһЩ³£ÓõĴúÂëʾÀý¡£

1. Éó²éÎļþµÄ»á¼ûʱ¼ä£¨atime£©

»á¼ûʱ¼äÖ¸µÄÊÇÎļþ×îºóÒ»´Î±»»á¼ûµÄʱ¼ä¡£ÒªÉó²éÎļþµÄ»á¼ûʱ¼ä£¬¿ÉÒÔʹÓà stat ÏÂÁ²¢ÍŽá awk ÏÂÁîÀ´Ìáȡʱ¼äÐÅÏ¢¡£Ê¾ÀýÈçÏ£º

stat -c %x filename.txt

µÇ¼ºó¸´ÖÆ

2. Éó²éÎļþµÄÐÞ¸Äʱ¼ä£¨mtime£©

ÐÞ¸Äʱ¼äÊÇÖ¸Îļþ×îºóÒ»´Î±»Ð޸ĵÄʱ¼ä¡£ÒªÉó²éÎļþµÄÐÞ¸Äʱ¼ä£¬Í¬Ñù¿ÉÒÔʹÓà stat ÏÂÁʾÀýÈçÏ£º

stat -c %y filename.txt

µÇ¼ºó¸´ÖÆ

3. Éó²éÎļþµÄ¸ü¸Äʱ¼ä£¨ctime£©

¸ü¸Äʱ¼äÊÇÖ¸ÎļþÔªÊý¾Ý£¨ºÃ±ÈÎļþȨÏÞ¡¢ËùÊôÓû§µÈ£©×îºóÒ»´Î±»Ð޸ĵÄʱ¼ä¡£Í¬ÑùʹÓà stat ÏÂÁʾÀýÈçÏ£º

stat -c %z filename.txt

µÇ¼ºó¸´ÖÆ

4. ×ÛºÏʾÀý£ºÉó²éÎļþµÄËùÓÐʱ¼äÐÅÏ¢

ÈôÊÇÒªÒ»´ÎÐÔÉó²éÎļþµÄËùÓÐʱ¼äÐÅÏ¢£¬¿ÉÒÔʹÓÃÈçÏÂÏÂÁ

stat filename.txt

µÇ¼ºó¸´ÖÆ

¸ÃÏÂÁî»áÊä³öÎļþµÄ»á¼ûʱ¼ä¡¢ÐÞ¸Äʱ¼ä¡¢¸ü¸Äʱ¼äµÈÏêϸÐÅÏ¢¡£

5. ÅúÁ¿Éó²éÎļþʱ¼äÐÅÏ¢

ÈôÊÇÐèÒªÅúÁ¿Éó²é¶à¸öÎļþµÄʱ¼äÐÅÏ¢£¬¿ÉÒÔÍŽáʹÓà find ÏÂÁîºÍ stat ÏÂÁʾÀýÈçÏ£º

find . -type f -exec stat -c "%n %x %y %z" {} ;

µÇ¼ºó¸´ÖÆ

½áÓï

ͨ¹ý±¾ÎĵÄÏÈÈÝ£¬Ï£Íû¶ÁÕß¿ÉÒÔÕÆÎÕÔÚ Linux ϵͳÖÐÉó²éÎļþʱ¼äÐÅÏ¢µÄ³£ÓòÙ×÷¡£ÊìÁ·Ê¹ÓÃÕâЩÏÂÁî¿ÉÒÔ×ÊÖúÄú¸üºÃµØÖÎÀíºÍά»¤Îļþ¡£ËäÈ»£¬ÔÚÏÖʵ²Ù×÷ÖУ¬ÄúÒ²¿ÉÒÔƾ֤ÏêϸµÄÐèÇó¶ÔÏÂÁî¾ÙÐнøÒ»²½µÄ¶¨ÖƺÍÀ©Õ¹¡£×£ÄúÔÚ Linux ϵͳÖÐÊÂÇé˳Ë죡

ÒÔÉϾÍÊdz£ÓÃµÄ Linux Îļþʱ¼äÉó²é²Ù×÷µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ