½â¾öLinux´ÅÅÌ¿Õ¼äȱ·¦ÎÊÌâµÄÒªÁì
ÔõÑù½â¾ölinuxϵͳÖг£¼ûµÄ´ÅÅÌ¿Õ¼äȱ·¦ÎÊÌâ
Ëæ×ÅÅÌËã»úºÍЧÀÍÆ÷µÄʹÓÃÆÕ¼°£¬´ÅÅÌ¿Õ¼äȱ·¦µÄÎÊÌâÔÚLinuxϵͳÖбäµÃÔ½À´Ô½³£¼û¡£´ÅÅÌ¿Õ¼äȱ·¦¿ÉÄܻᵼÖÂϵͳÐÔÄÜϽµ£¬Ó¦ÓóÌÐòÎÞ·¨Õý³£ÔËÐУ¬ÉõÖÁµ¼ÖÂϵͳÍ߽⡣ΪÁËÌá¸ßϵͳµÄÎȹÌÐÔºÍÐÔÄÜ£¬ÊµÊ±½â¾ö´ÅÅÌ¿Õ¼äȱ·¦ÎÊÌâºÜÊÇÖ÷Òª¡£
±¾ÎĽ«ÏÈÈÝһЩ³£¼ûµÄ½â¾öÒªÁ죬×ÊÖúÓû§ÓÐÓýâ¾ö´ÅÅÌ¿Õ¼äȱ·¦µÄÎÊÌâ¡£
ÕûÀíÎÞÓÃÎļþ£º
Ê×ÏÈ£¬²éÕÒ²¢É¾³ýÎÞÓõÄÎļþ¡£¿ÉÒÔʹÓÃÏÂÁîÐй¤¾ßÈçfindºÍrmÀ´ÊµÏÖ¡£
ÀýÈ磬¿ÉÒÔÓÃÒÔÏÂÏÂÁî²éÕÒºÍɾ³ý1ÌìǰδʹÓùýµÄÈÕÖ¾Îļþ£º
find /var/log -type f -mtime +1 -exec rm {} ;
µÇ¼ºó¸´ÖÆ
ͬÑùµÄ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî²éÕÒ²¢É¾³ý10MBÒÔÉϵÄÎÞÓÃÎļþ£º
find /path/to/directory -type f -size +10M -exec rm {} ;
µÇ¼ºó¸´ÖÆ
ɾ³ý»º´æÎļþ£º
»º´æÎļþÊÇÔÝʱ´æ´¢ÔÚ´ÅÅÌÉϵÄÊý¾Ý£¬¿ÉÒÔÔÚÐèҪʱ±»ÖØÐÂʹÓ᣿ÉÊÇ£¬»º´æÎļþÒ²»áÕ¼Óôó×ڵĴÅÅ̿ռ䡣¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´É¾³ý»º´æÎļþ£º
sudo du -sh /var/cache/apt sudo apt clean
µÇ¼ºó¸´ÖÆ
Õ⽫ɾ³ýaptÈí¼þ°ü¹ÜÀíÆ÷µÄ»º´æÎļþ£¬ÊÍ·ÅһЩ´ÅÅ̿ռ䡣
ѹËõºÍ¹éµµÎļþ£º
ѹËõºÍ¹éµµÎļþ¿ÉÒÔÓÐÓõؽÚÔ¼´ÅÅ̿ռ䡣¿ÉÒÔʹÓù¤¾ßÈçtarºÍgzipÀ´ÊµÏÖ¡£
ÀýÈ磬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁÎļþ¼ÐѹËõΪtar.gzÃûÌãº
tar -czvf archive.tar.gz /path/to/folder
µÇ¼ºó¸´ÖÆ
Õ⽫½¨ÉèÒ»¸öѹËõÎļþ£¬Õ¼ÓõĴÅÅÌ¿Õ¼ä¸üÉÙ¡£
ɾ³ý²»ÐèÒªµÄÈí¼þºÍ°ü£º
²éÕÒ²¢É¾³ý²»ÐèÒªµÄÈí¼þºÍ°üÒ²¿ÉÒÔÊÍ·ÅÒ»¶¨µÄ´ÅÅ̿ռ䡣¿ÉÒÔʹÓÃÈí¼þ°ü¹ÜÀíÆ÷¾ÙÐÐɾ³ý£¬Èçapt»òyum¡£
ÀýÈ磬ʹÓÃÒÔÏÂÏÂÁîɾ³ý²»ÐèÒªµÄÈí¼þ£º
sudo apt remove package_name
µÇ¼ºó¸´ÖÆ
»òÕßʹÓÃÒÔÏÂÏÂÁîɾ³ý²»ÐèÒªµÄÈí¼þ°ü¼°ÆäÒÀÀµÏ
sudo apt autoremove package_name
µÇ¼ºó¸´ÖÆ
À©ÈÝ´ÅÅ̿ռ䣺
ÈôÊÇÒÔÉÏÒªÁìÎÞ·¨½â¾ö´ÅÅÌ¿Õ¼äȱ·¦µÄÎÊÌ⣬¿ÉÒÔ˼Á¿À©ÈÝ´ÅÅ̿ռ䡣¿ÉÒÔ¹ºÖÃеÄÓ²ÅÌ»òÕßÔÚÔÆƽ̨ÉÏÀ©Õ¹´ÅÅ̿ռ䡣
¹ØÓÚ×ÔÁ¦Ð§ÀÍÆ÷£¬¿ÉÒÔ½«ÐµÄÓ²ÅÌÌí¼Óµ½ÏµÍ³ÖУ¬²¢Ê¹ÓÃLVM£¨Âß¼¾íÖÎÀí£©À´À©Õ¹´ÅÅ̿ռ䡣
¹ØÓÚÔÆƽ̨ÉϵÄʹÓÃÕߣ¬¿ÉÒÔͨ¹ýÔÆƽ̨ÌṩµÄÖÎÀíÃæ°åÀ´À©Õ¹´ÅÅ̿ռ䡣
×ܽ᣺
´ÅÅÌ¿Õ¼äȱ·¦ÊÇLinuxϵͳ³£¼ûµÄÎÊÌâÖ®Ò»£¬µ«Í¨¹ýһЩ¼òÆÓµÄÒªÁì¿ÉÒÔ½â¾ö¡£ÕûÀíÎÞÓÃÎļþ£¬É¾³ý»º´æÎļþ£¬Ñ¹ËõºÍ¹éµµÎļþ£¬É¾³ý²»ÐèÒªµÄÈí¼þ£¬À©ÈÝ´ÅÅÌ¿Õ¼äµÈÒªÁ춼¿ÉÒÔ×ÊÖúÓû§ÓÐÓýâ¾ö´ÅÅÌ¿Õ¼äȱ·¦µÄÎÊÌ⡣ƾ֤ÏÖÕæÏàÐÎÑ¡ÔñÊÊÓõÄÒªÁ죬¿ÉÒÔÌá¸ßϵͳµÄÎȹÌÐÔºÍÐÔÄÜ¡£
ÒÔÉϾÍÊǽâ¾öLinux´ÅÅÌ¿Õ¼äȱ·¦ÎÊÌâµÄÒªÁìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡