Linux/Unix ³£ÓÃÃüÁîÈý
¾Å¡¢kill
1.×÷ÓÃ
killÃüÁîÓÃÀ´ÖÐÖ¹Ò»¸ö½ø³Ì¡£
2.¸ñʽ
kill [ £s signal | £p ] [ £a ] pid ...
kill £l [ signal ]
3.²ÎÊý
£s£ºÖ¸¶¨·¢Ë͵ÄÐźš£
£p£ºÄ£Äâ·¢ËÍÐźš£
£l£ºÖ¸¶¨ÐźŵÄÃû³ÆÁÐ±í¡£
pid£ºÒªÖÐÖ¹½ø³ÌµÄIDºÅ¡£
Signal£º±íʾÐźš£
4.˵Ã÷
½ø³ÌÊÇLinuxϵͳÖÐÒ»¸ö·Ç³£ÖØÒªµÄ¸ÅÄî¡£LinuxÊÇÒ»¸ö¶àÈÎÎñµÄ²Ù×÷ϵͳ£¬ÏµÍ³ÉϾ³£Í¬Ê±ÔËÐÐ×Ŷà¸ö½ø³Ì¡£ÎÒÃDz»¹ØÐÄÕâЩ½ø³Ì¾¿¾¹ÊÇÈçºÎ·ÖÅäµÄ£¬»òÕßÊÇÄÚºËÈçºÎ¹ÜÀí·ÖÅäʱ¼äƬµÄ£¬Ëù¹ØÐĵÄÊÇÈçºÎÈ¥¿ØÖÆÕâЩ½ø³Ì£¬ÈÃËüÃÇÄܹ»ºÜºÃµØΪÓû§·þÎñ¡£
Linux ²Ù×÷ϵͳ°üÀ¨ÈýÖÖ²»Í¬ÀàÐ͵Ľø³Ì£¬Ã¿ÖÖ½ø³Ì¶¼ÓÐ×Ô¼ºµÄÌصãºÍÊôÐÔ¡£½»»¥½ø³ÌÊÇÓÉÒ»¸öShellÆô¶¯µÄ½ø³Ì¡£½»»¥½ø³Ì¼È¿ÉÒÔÔÚǰ̨ÔËÐУ¬Ò²¿ÉÒÔÔÚºǫ́ÔËÐС£Åú´¦Àí½ø³ÌºÍÖÕ¶ËûÓÐÁªÏµ£¬ÊÇÒ»¸ö½ø³ÌÐòÁС£¼à¿Ø½ø³Ì£¨Ò²³ÆϵͳÊØ»¤½ø³Ì£©Ê±LinuxϵͳÆô¶¯Ê±Æô¶¯µÄ½ø³Ì£¬²¢ÔÚºǫ́ÔËÐС£ÀýÈ磬httpdÊÇÖøÃûµÄ Apache·þÎñÆ÷µÄ¼à¿Ø½ø³Ì¡£
killÃüÁîµÄ¹¤×÷ÔÀíÊÇ£¬ÏòLinuxϵͳµÄÄں˷¢ËÍÒ»¸öϵͳ²Ù×÷ÐźźÍij¸ö³ÌÐòµÄ½ø³Ì±êʶºÅ£¬È»ºóϵͳÄں˾ͿÉÒÔ¶Ô½ø³Ì±êʶºÅÖ¸¶¨µÄ½ø³Ì½øÐвÙ×÷¡£±ÈÈçÔÚtopÃüÁîÖУ¬ÎÒÃÇ¿´µ½ÏµÍ³ÔËÐÐÐí¶à½ø³Ì£¬ÓÐʱ¾ÍÐèҪʹÓÃkillÖÐֹijЩ½ø³ÌÀ´Ìá¸ßϵͳ×ÊÔ´¡£ÔÚ½²½â°²×°ºÍµÇ½ÃüÁîʱ£¬ÔøÌᵽϵͳ¶à¸öÐéÄâ¿ØÖÆ̨µÄ×÷ÓÃÊǵ±Ò»¸ö³ÌÐò³ö´íÔì³ÉϵͳËÀËøʱ£¬¿ÉÒÔÇл»µ½ÆäËüÐéÄâ¿ØÖÆ̨¹¤×÷¹Ø±ÕÕâ¸ö³ÌÐò¡£´ËʱʹÓõÄÃüÁî¾ÍÊÇkill£¬ÒòΪkillÊÇ´ó¶àÊýShellÄÚ²¿ÃüÁî¿ÉÒÔÖ±½Óµ÷Óõġ£
5.Ó¦ÓÃʵÀý
£¨1£©Ç¿ÐÐÖÐÖ¹£¨¾³£Ê¹ÓÃɱµô£©Ò»¸ö½ø³Ì±êʶºÅΪ324µÄ½ø³Ì£º
££kill £9 324
£¨2£©½â³ýLinuxϵͳµÄËÀËø
ÔÚLinux ÖÐÓÐʱ»á·¢ÉúÕâÑùÒ»ÖÖÇé¿ö£ºÒ»¸ö³ÌÐò±ÀÀ££¬²¢ÇÒ´¦ÓÚËÀËøµÄ״̬¡£´Ëʱһ°ã²»ÓÃÖØÐÂÆô¶¯¼ÆËã»ú£¬Ö»ÐèÒªÖÐÖ¹(»òÕß˵ÊǹرÕ)Õâ¸öÓÐÎÊÌâµÄ³ÌÐò¼´¿É¡£µ± kill´¦ÓÚX-Window½çÃæʱ£¬Ö÷ÒªµÄ³ÌÐò(³ýÁ˱ÀÀ£µÄ³ÌÐòÖ®Íâ)Ò»°ã¶¼ÒѾÕý³£Æô¶¯ÁË¡£´Ëʱ´ò¿ªÒ»¸öÖնˣ¬ÔÚÄÇÀïÖÐÖ¹ÓÐÎÊÌâµÄ³ÌÐò¡£±ÈÈ磬Èç¹û Mozillaä¯ÀÀÆ÷³ÌÐò³öÏÖÁËËøËÀµÄÇé¿ö£¬¿ÉÒÔʹÓÃkillÃüÁîÀ´ÖÐÖ¹ËùÓаüº¬ÓÐMozollaä¯ÀÀÆ÷µÄ³ÌÐò¡£Ê×ÏÈÓÃtopÃüÁî²é´¦¸Ã³ÌÐòµÄPID£¬È»ºóʹÓÃkillÃüÁîÍ£Ö¹Õâ¸ö³ÌÐò£º
££kill £SIGKILL XXX
ÆäÖУ¬XXXÊÇ°üº¬ÓÐMozollaä¯ÀÀÆ÷µÄ³ÌÐòµÄ½ø³Ì±êʶºÅ¡£
£¨3£©Ê¹ÓÃÃüÁî»ØÊÕÄÚ´æ
ÎÒÃÇÖªµÀÄÚ´æ¶ÔÓÚϵͳÊǷdz£ÖØÒªµÄ£¬»ØÊÕÄÚ´æ¿ÉÒÔÌá¸ßϵͳ×ÊÔ´¡£killÃüÁî¿ÉÒÔ¼°Ê±µØÖÐֹһЩ“Ô½¹ì”µÄ³ÌÐò»òºÜ³¤Ê±¼äûÓÐÏàÓ¦µÄ³ÌÐò¡£ÀýÈ磬ʹÓÃtopÃüÁî·¢ÏÖÒ»¸öÎÞÓà (Z
Ïà¹ØÎĵµ£º
Linux Device Drivers, 3rd Edition
2.3.1. User Space and Kernel Space
Äں˿ռäºÍÓû§¿Õ¼ä
Unix transfers execution from user space to kernel space whenever an application issues a system call or is suspended by a hardware interrupt. Kernel code executing a system call is working in the context of a ......
½ø³Ì¼äͨОÍÊÇÔÚ²»Í¬½ø³ÌÖ®¼ä´«²¥»ò½»»»ÐÅÏ¢£¬ÄÇô²»Í¬½ø³ÌÖ®¼ä´æÔÚ×Åʲô˫·½¶¼¿ÉÒÔ·ÃÎʵĽéÖÊÄØ£¿½ø³ÌµÄÓû§¿Õ¼äÊÇ»¥Ïà¶ÀÁ¢µÄ£¬Ò»°ã¶øÑÔÊDz»ÄÜ»¥Ïà·ÃÎʵģ¬Î¨Ò»µÄÀýÍâÊǹ²ÏíÄÚ´æÇø¡£µ«ÊÇ£¬ÏµÍ³¿Õ¼äÈ´ÊÇ“¹«¹²³¡Ëù”£¬ËùÒÔÄÚºËÏÔÈ»¿ÉÒÔÌṩÕâÑùµÄÌõ¼þ¡£³ý´ËÒÔÍ⣬ÄǾÍÊÇË«·½¶¼¿ ......
1.±ä¸üÓû§£º su root »ò su - ×¢Ò⣨ÈôÖ»ÓÃsu£¬ÔòÖ»»»Óû§£¬²»»»shell£©¡£
2.´´½¨Îļþ¼Ð£º mkdir -m777 tool ´´½¨too²¢ÉèÖÃȨÏÞ mkdir -p tool2/tool3 Á¬¼¶´´½¨Îļþ¼Ð¡£
3.ɾ³ýÎļþ»òÎļþ¼Ð£º rm -r tool2 µÝ¹éɾ³ý£¬Á¬Í¬×ÓĿ¼һÆðɾ³ý¡£ rm -fr ²»ÓÃÌáʾ£¬Ö±½ÓÇ¿ÖƵݹéɾ³ý¡£
4.Òƶ¯Ä¿Â¼£º mv -iv ......
ËÄ¡¢quota
1.×÷ÓÃ
quotaÃüÁîÓÃÀ´ÏÔʾ´ÅÅÌʹÓÃÇé¿öºÍÏÞÖÆÇé¿ö£¬Ê¹ÓÃȨÏÞ³¬¼¶Óû§¡£
2.¸ñʽ
quota [£g][£u][£v][£p] Óû§Ãû ×éÃû
3.²ÎÊý
£g£ºÏÔʾÓû§ËùÔÚ×éµÄ´ÅÅÌʹÓÃÏÞÖÆ¡£
£u£ºÏÔʾÓû§µÄ´ÅÅÌʹÓÃÏÞÖÆ¡£
£v£ºÏÔʾûÓзÖÅä¿Õ¼äµÄÎļþϵͳµÄ·ÖÅäÇé¿ö¡£
£p£ºÏÔʾ¼ò»¯ÐÅÏ¢¡£
4.Ó¦ÓÃʵÀý
ÔÚÆóÒµÓ¦ÓÃÖдÅÅÌÅä ......