Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxÏ¿ÉÒÔÌæ»»ÔËÐÐÖеijÌÐòô?

½ñÌì±»ÅóÓÑÎʼ°“LinuxÏ¿ÉÒÔÌæ»»ÔËÐÐÖеijÌÐòô£¿”£¬ÒÔÇ°ÒÀÏ¡¼ÇµÃLinuxÏÂÊÇ¿ÉÒԵģ¨¶øWindows¾Í²»Èã©£¬ÓÚÊÇËæ¿Ú´ðµÀ“OK”¡£½á¹ûÅóÓÑ·¢À´Ò»¸öÖ´Ðнá¹û£º£¨testÕýÔÚÔËÐÐÖУ©
# cp test2 test
cp: cannot create regular file `test': Text file busy
¿´ÆðÀ´ÊdzÌÐò±»Õ¼Óã¬ÎÞ·¨¸²¸Ç¡£ÓÚÊÇ×Ô¼ºÓÖÔÙ×öÁ˼¸¸öʵÑ飺
£¨1£©ÏÈrmɾ³ýÕýÔÚÔËÐеÄtest£¬È»ºócp test2 test¾ÍûÓдíÎóÁË¡£
£¨2£©ÏÈmv¸ÄÃûÕýÔÚÔËÐеÄtest£¬È»ºócp test2 testҲûÓÐÎÊÌâ¡£
²éÁ˲é×ÊÁϲ¢¶¯ÊÖ·ÖÎöÁËһϣ¬ÕÒµ½Á˱ȽÏÂúÒâµÄ½âÊÍ¡£cp²¢²»¸Ä±äÄ¿±êÎļþµÄinode£¬ÊÂʵÉÏËüµÄʵÏÖÊÇÕâÑùµÄ£º
# strace cp test2 test  2>&1 | grep open.*test
open("test2", O_RDONLY|O_LARGEFILE)     = 3
open("test", O_WRONLY|O_TRUNC|O_LARGEFILE) = 4
ÎÒÔ­ÒÔΪcpµÄʵÏÖÊÇ“rm + open(O_CREAT)”£¬²»¹ýÏÖÔÚÏëÏëÉÏÃæµÄʵÏÖ·½Ê½²ÅÊÇ×î¿É¿¿µÄ£¨±£Ö¤ÁËʱÐò°²È«ºÍÄ¿±êÎļþµÄÊôÐÔ£©¡£ÕâÒ²¿ÉÒÔ½âÊÍΪʲôcpµÄÄ¿±êÎļþ»á¼Ì³Ð±»¸²¸ÇÎļþµÄÊôÐÔ¶ø·ÇÔ´Îļþ¡£
LinuxÓÉÓÚDemand Paging»úÖƵĹØϵ£¬±ØÐëÈ·±£ÕýÔÚÔËÐÐÖеijÌÐò¾µÏñ£¨×¢Ò⣬²¢·ÇÎļþ±¾Éí£©²»±»ÒâÍâÐ޸ģ¬Òò´ËÄÚºËÔÚÆô¶¯³ÌÐòºó»áËø¶¨Õâ¸ö³ÌÐò¾µÏñµÄinode¡£Õâ¾Í ÊÇΪʲôcpÔÚÓÓO_WRONLY|O_TRUNC”ģʽopenÄ¿±êÎļþʱ»áʧ°Ü¡£¶øÏÈrmÔÙcpµÄ»°£¬ÐÂÎļþµÄinodeÆäʵÒѾ­¸Ä±äÁË£¬Ô­ inode²¢Ã»Óб»ÕæÕýɾ³ý£¬Ö±µ½ÄÚºËÊͷŶÔËüµÄÒýÓá£Í¬Àí£¬mvÖ»ÊǸıäÁËÎļþÃû£¬Æäinode²»±ä£¬ÐÂÎļþʹÓÃÁËеÄinode¡£
ÎÊÌâµ½ÕâÀïÒѾ­Ë®Âäʯ³ö£¬²»¹ýÅÙ¸ù¾¿µ×µÄ¸öÐÔÇýʹÎÒÔÙ×öÁËÒÔÏÂÒ»×éʵÑ飬ûÏëµ½½á¹ûÍêÈ«³öºõÎÒÒâÁÏÖ®Í⣡
дÁËÒ»¸ö¼òµ¥µÄ²âÊÔ³ÌÐò£º
#include <stdio.h>
int main(int argc, char * argv[])
{
foo();  // An export function by libtest.so.
sleep(1000);
return 0;
}
foo()ÊÇÁíÒ»¸ö²âÊÔ¶¯Ì¬¿âlibtest.soµÄµ¼³ö½Ó¿Ú£¬Ö»´òÓ¡Ò»ÐÐÌáʾ¾Í·µ»Ø¡£½ÓÏÂÀ´ÎÒ°ÑÉÏÃæ¶ÔÖ´ÐÐÎļþµÄ²âÊÔÓÃÀý¶Ô¶¯Ì¬¿âÓÖ×öÁËÒ»±é£º
£¨1£©cp libtest2.so libtest.so¿ÉÒÔÖ±½Ó¸²¸ÇÒѼÓÔصĶ¯Ì¬¿â¡£
£¨2£©ÏÈrmɾ³ýÒѼÓÔصÄlibtest.so£¬È»ºócp libtest2.so libtest.so³É¹¦¡£
£¨3£©ÏÈmv¸ÄÃûÒѼÓÔصÄlibtest.so£¬È»ºócp libtest2.so libtest.so³É¹¦¡£
³ýÁ˵ÚÒ»¸öÓÃÀýÍ⣬½á¹ûÏàͬ¡£ÕâÑù¿´À´£¬¶¯Ì¬¿â±»¼ÓÔØʱÄѵÀld²¢Ã»ÓÐËø¶¨inode£¿²»¹ýÏëÏëÒ²¿ÉÒÔ¿íË¡£¬±Ï¾¹ldÒ²ÊÇÓû§Ì¬³


Ïà¹ØÎĵµ£º

Linux·ÖÇø·½°¸×î½ÚÊ¡µÄ·ÖÇø·½°¸

ÏëÖªµÀµ½Linux·ÖÇø·½°¸µÄÕæÏàô£¬ÏëÖªµÀLinux·ÖÇø·½°¸ÖвØÓеÄÄÚÔÚ°ÂÒåô£¬Ö»ÓÐÎÒÀ´¸ø´ó¼ÒÈ«Ãæ½²½â½éÉÜLinux·ÖÇø·½°¸
×îÐÂLinux·ÖÇø·½°¸

ÎҵķþÎñÆ÷ÊÇ500G¡£×îÖØÒªµÄÊÇ/var·ÖÇøÒ»¶¨Òª´ó(²»ÂÛpostfixÓʼþ£¬»¹ÊÇLAMPµÄWEB ·þÎñÆ÷µÈ£©¡£×îºÃÊÇ400GÒÔÉÏ¡£¾ßÌåµÄ/boot Ö»Òª100M¾Í×ã¹»ÁË¡£ÏÂÃæÊÇÎҵķÖÇø·½°¸£ºÓ²ÅÌ500G
·þ ......

linuxϵͳά»¤³£ÓòÙ×÷ÃüÁî

linuxϲ鿴Ŀ¼´óС- -
 du -sb /dir
²éÕÒµ±Ç°Óû§Ö÷Ŀ¼ÏµÄËùÓÐÎļþ
find . -print
²éÕÒ/var/logsĿ¼Öиü¸Äʱ¼äÔÚ7ÈÕÒÔÇ°µÄÆÕͨÎļþ£¬²¢ÔÚɾ³ý֮ǰѯÎÊËüÃÇ
find /var/logs -type f -mtime +7 -ok rm {  } \;
δÍê´ýÐø£¡ ......

linux»·¾³±àÒëc++¶¯Ì¬¿âÒÔ¼°µ÷Ó÷½Ê½

ÉÏÒ»´ÎÓÃlinuxÊÇ2002ÄêÓÃkdevelop¼°qt¿â¿ª·¢¶àýÌåÈí¼þ¡£
ʱ¸ô8ÄêÔÙÒ»´ÎÔÚlinuxϸ㿪·¢£¬ÒÀÈ»²ËÄñ£¬»¹ÊÇÉúÊè¡£
¸Ð¾õ×Ô¼ºµÄ´óÄԵĴ洢¿Õ¼ä£¬Ëæ×ÅÄêÁäµÄÔö¼ÓÔÚ±äС£¬ºÜ¶àŪ¹ýµÄ£¬ÓÖÖ»ÄÜ´ÓͷѧÆð¡£
²»¹ýÓо仰“»îµ½ÀÏ£¬Ñ§µ½ÀÏ”¹þ£¡
²ÑÀ¢£¬²ÑÀ¢¡£
1¡¢±àд¶¯Ì¬¿âµÄc++Îļþ
    cvpnlib.cpp cv ......

Linux²é¿´Ó²¼þÐÅÏ¢

ÔÚLINUX»·¾³¿ª·¢Çý¶¯³ÌÐò£¬Ê×ÏÈҪ̽²âµ½ÐÂÓ²¼þ£¬½ÓÏÂÀ´¾ÍÊÇ¿ª·¢Çý¶¯³ÌÐò¡£
³£ÓÃÃüÁîÕûÀíÈçÏ£º
ÓÃÓ²¼þ¼ì²â³ÌÐòkudzu̽²âÐÂÓ²¼þ£ºservice kudzu start ( or restart)
²é¿´CPUÐÅÏ¢£ºcat /proc/cpuinfo
²é¿´°å¿¨ÐÅÏ¢£ºcat /proc/pci
²é¿´PCIÐÅÏ¢£ºlspci (Ïà±Ècat /proc/pci¸üÖ±¹Û£©
²é¿´ÄÚ´æÐÅÏ¢£ºcat /proc/memin ......

LinuxÖÐÈçºÎн¨Óû§


¶ÔÓÚÒ»°ãÓû§À´Ëµ£¬Ö÷Ŀ¼£¨home directory£©ÊÇÓ²ÅÌÉÏΨһ¿ÉÒÔÔ­À´Ð´¶«Î÷µÄµØ·½¡£Ò»°ãµÄ·¾¶ÃûÊÇ/home/login_user_name¡£
Ö÷Ŀ¼ÓÃÓÚ´æ´¢¸÷ÖÖÓû§Îļþ£ºÉèÖÃÎļþ£¬³ÌÐòÅäÖÃÎļþ£¬Óû§Îĵµ£¬Êý¾Ý netscape µÄ»º´æ£¬ÓʼþµÈµÈ¡£×÷Ϊһ¸öÆÕͨÓû§£¬Äã¿ÉÒÔÔÚÖ÷Ŀ¼Ï½¨Á¢ÐµÄĿ¼°²ÅÅÄã×Ô¼ºµÄĿ¼½á¹¹¡£ÆäËûÓû§ÎÞ·¨ÔĶÁÄãµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ