³£ÓÃµÄ 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 Îļþʱ¼äÉó²é²Ù×÷µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡