Linux½ø³Ì¹ÜÀíÃüÁîÏê½â(psºÍtop)
Linux½ø³Ì¹ÜÀíÃüÁîÏê½â(psºÍtop)
1.psÃüÁî
×÷ÓãºpsÃüÁîÖ÷Òª²é¿´ÏµÍ³Öнø³ÌµÄ״̬¡£
¸ñʽ£ºps [Ñ¡Ïî]
Ö÷ҪѡÏîÈçÏ¡£
-A£ºÏÔʾϵͳÖÐËùÓнø³ÌµÄÐÅÏ¢¡£
-e£ºÏÔʾËùÓнø³ÌµÄÐÅÏ¢¡£
-f£ºÏÔʾ½ø³ÌµÄËùÓÐÐÅÏ¢¡£
-l£ºÒÔ³¤¸ñʽÏÔʾ½ø³ÌÐÅÏ¢¡£
-r£ºÖ»ÏÔʾÕýÔÚÔËÐеĽø³Ì¡£
-u£ºÏÔʾÃæÏòÓû§µÄ¸ñʽ£¨°üÀ¨Óû§Ãû¡¢CPU¼°ÄÚ´æʹÓÃÇé¿öµÈÐÅÏ¢£©¡£
-x£ºÏÔʾËùÓзǿØÖÆÖÕ¶ËÉϵĽø³ÌÐÅÏ¢¡£
-p£ºÏÔʾÓɽø³ÌIDÖ¸¶¨µÄ½ø³ÌµÄÐÅÏ¢¡£
-t£ºÏÔʾָ¶¨ÖÕ¶ËÉϵĽø³ÌµÄÐÅÏ¢¡£
˵Ã÷£ºÒª¶Ô½ø³Ì½øÐмà²âºÍ¿ØÖÆ£¬Ê×ÏÈÒªÁ˽⵱ǰ½ø³ÌµÄÇé¿ö£¬Ò²¾ÍÊÇÐèÒª²é¿´µ±Ç°½ø³Ì¡£psÃüÁî¾ÍÊÇ×î»ù±¾¡¢Ò²ÊǷdz£Ç¿´óµÄ½ø³Ì²é¿´ÃüÁî¡£¸ù¾ÝÏÔʾµÄÐÅÏ¢¿ÉÒÔÈ·¶¨Äĸö½ø³ÌÕýÔÚÔËÐС¢Äĸö½ø³Ì±»¹ÒÆð¡¢½ø³ÌÒÑÔËÐÐÁ˶à¾Ã¡¢½ø³ÌÕýÔÚʹÓõÄ×ÊÔ´¡¢½ø³ÌµÄÏà¶ÔÓÅÏȼ¶£¬ÒÔ¼°½ø³ÌµÄ±êÖ¾ºÅ£¨PID£©¡£ËùÓÐÕâЩÐÅÏ¢¶ÔÓû§¶¼ºÜÓÐÓ㬶ÔÓÚϵͳ¹ÜÀíÔ±À´Ëµ¸üΪÖØÒª¡£Ê¹ÓÔps £aux”ÃüÁî¿ÉÒÔ»ñµÃÖÕ¶ËÉÏËùÓÐÓû§µÄÓйؽø³ÌµÄËùÓÐÐÅÏ¢£¬ÏÂÃæ½áºÏͼ½²½â½ø³ÌµÄ»ù±¾ÐÅÏ¢¡£
ͼÖеڶþÐдúÂëÖУ¬USER±íʾÆô¶¯½ø³ÌÓû§¡£PID±íʾ½ø³Ì±êÖ¾ºÅ¡£%CPU±íʾÔËÐиýø³ÌÕ¼ÓÃCPUµÄʱ¼äÓë¸Ã½ø³Ì×ܵÄÔËÐÐʱ¼äµÄ±ÈÀý¡£%MEM±íʾ¸Ã½ø³ÌÕ¼ÓÃÄÚ´æºÍ×ÜÄÚ´æµÄ±ÈÀý¡£VSZ±íʾռÓõÄÐéÄâÄÚ´æ´óС£¬ÒÔKBΪµ¥Î»¡£RSSΪ½ø³ÌÕ¼ÓõÄÎïÀíÄÚ´æÖµ£¬ÒÔKBΪµ¥Î»¡£TTY±íʾ¸Ã½ø³Ì½¨Á¢Ê±Ëù¶ÔÓ¦µÄÖնˣ¬”?”±íʾ¸Ã½ø³Ì²»Õ¼ÓÃÖնˡ£STAT±íʾ½ø³ÌµÄÔËÐÐ״̬£¬°üÀ¨ÒÔϼ¸ÖÖ´úÂ룺D£¬²»¿ÉÖжϵÄ˯Ãߣ»R£¬¾ÍÐ÷£¨ÔÚ¿ÉÔËÐжÓÁÐÖУ©£»S£¬Ë¯Ãߣ»T£¬±»¸ú×Ù»òÍ£Ö¹£»Z£¬ÖÕÖ¹£¨½©ËÀ£©µÄ½ø³Ì£¬Z²»´æÔÚ£¬µ«ÔÝʱÎÞ·¨Ïû³ý£»W£¬Ã»ÓÐ×ã¹»µÄÄÚ´æ·ÖÒ³¿É·ÖÅ䣻<¸ßÓÅÏÈÐòµÄ½ø³Ì£»N£¬µÍÓÅÏÈÐòµÄ½ø³Ì£»L£¬ÓÐÄÚ´æ·ÖÒ³·ÖÅä²¢ËøÔÚÄÚ´æÌåÄÚ£¨ÊµÊ±ÏµÍ³»òI/O£©¡£STARTΪ½ø³Ì¿ªÊ¼Ê±¼ä¡£TIMEΪִÐеÄʱ¼ä¡£COMMANDÊǶÔÓ¦µÄÃüÁîÃû¡£
Ó¦ÓÃʵÀýÈçÏ¡£
ÔÚ½øÐÐϵͳά»¤Ê±£¬Èç¹ûCPU¸ºÔØͻȻÔö¼Ó£¬¶øÓÖ²»ÖªµÀÊÇÄÄÒ»¸ö½ø³ÌÔì³ÉµÄÇé¿ö¡£Ê¹ÓÃÃüÁ
££ps aux | sort +3n
ÒòΪ%CPUÑ¡ÏîÔÚµÚÈýÁУ¬ËùÒÔsortÑ¡3×÷Ϊ²ÎÊý£¬£«±íʾÉýÐòÊä³ö½á¹û¡£
2.topÃüÁî
topÃüÁîÓÃÀ´ÏÔʾϵͳµ±Ç°µÄ½ø³Ì×´¿ö¡£
¸ñʽ£ºtop [Ñ¡Ïî]
Ö÷ҪѡÏîÈçÏ¡£
d£ºÖ¸¶¨¸üеļä¸ô£¬ÒÔÃë¼ÆËã¡£
q£ºÃ»ÓÐÈκÎÑӳٵĸüС£Èç¹ûʹÓÃÕßÓг¬¼¶Óû§£¬ÔòtopÃüÁ»áÒÔ×î¸ßµÄÓÅÏÈÐòÖ´ÐС£
c£ºÏÔʾ½ø³ÌÍêÕûµÄ·¾¶ÓëÃû³Æ¡£
S£ºÀÛ»ýģʽ£¬»á½«ÒÑÍê³É»òÏûʧµÄ×Ó½ø³ÌµÄCPUʱ¼äÀÛ»ýÆðÀ´¡£
s£º°²È«Ä£Ê½¡£
i£º²»ÏÔʾÈκ
Ïà¹ØÎĵµ£º
ʲôÊÇÒ첽ͨѶ£¿
¾ÍÊÇͨѶÈÎÒâÒ»·½¿ÉÒÔÈÎÒâ·¢ËÍÏûÏ¢£¬ÓÐÏûÏ¢À´µ½Ê±»áÊÕµ½ÏµÍ³Ìáʾȥ½ÓÊÕÏûÏ¢¡£
ÕâÀïÒªÓõ½selectº¯Êý¡£Ê¹Óò½ÖèÈçÏ£º
1¡¢ÉèÖÃÒ»¸ö¼¯ºÏ±äÁ¿£¬ÓÃÀ´´æ·ÅËùÓÐÒªÅжϵľä±ú£¨file descriptors£º¼´ÎÒÃǽ¨Á¢µÄÿ¸ösocket¡¢ÓÃopen´ò¿ªµÄÿ¸öÎļþµÈ£©
2¡¢°ÑÐèÒªÅжϵľä±ú¼ÓÈëµ½¼¯ºÏÀï
3¡¢ÉèÖÃÅжÏʱ¼ä
4¡¢¿ª ......
²»Í¬µÄLinuxÖ®¼äcopyÎļþ³£ÓÃÓÐ3ÖÖ·½·¨
£¬µÚÒ»ÖÖ¾ÍÊÇftp£¬Ò²¾ÍÊÇÆäÖÐһ̨Linux°²×°ftp Server£¬ÕâÑù¿ÉÒÔÁíÍâһ̨ʹÓÃftpµÄclient³ÌÐòÀ´½øÐÐÎļþµÄcopy¡£µÚ¶þÖÖ·½·¨¾ÍÊDzÉÓÃsamba·þÎñ£¬ÀàËÆWindows
ÎļþcopyµÄ·½Ê½À´²Ù×÷£¬±È½Ï¼ò½à·½±ã£¬µÚÈýÖÖ¾ÍÊÇÀûÓÃscpÃüÁîÀ´½øÐÐÎļþ¸´ÖÆ¡£
scpÊÇÓÐSecurityµÄÎļþcopy£¬»ùÓÚsshµÇ¼ ......
°æ±¾10.2
ÔÚ9iÏÂdbstart´æÔÚÒ»bug£ºdbstartÆô¶¯Ê±ÔÚ$ORACLE_HOME/dbsÏÂÑ°ÕÒinitSID.ora£¬ÊÂʵÉÏÔÚ¸ÃĿ¼Ï²»´æÔÚÕâ¸öpfile£¬ÔÚ9i ÒѾʹÓÃÁËspfile£¬ËùÒÔÒªÏëÕý³£Í¨¹ýdbstartÆô¶¯db£¬ÐèÒªÔÚĿ¼$ORACLE_HOME/dbsÏ´´½¨Ò»¸öinitSID.ORAÎļþ£¬10gÖÐÎÒ·¢ÏÖÐÞÕýÁËÕâÒ»ÎÊÌâ¡£²»¹ý10gÖÐdbstartÔÚ×Ô¶¯Æô¶¯listenerʱ´æÔÚÒ»ÎÊÌ⣠......
²é¿´µ±Ç°Ä¿Â¼ÏÂÎļþµÄ¸öÊý
ls -l | grep "^-" | wc -l
²é¿´µ±Ç°Ä¿Â¼ÏÂÎļþµÄ¸öÊý£¬°üÀ¨×ÓĿ¼ÀïµÄ¡£
ls -lR| grep "^-" | wc -l
²é¿´Ä³Ä¿Â¼ÏÂÎļþ¼Ð£¨Ä¿Â¼£©µÄ¸öÊý£¬°üÀ¨×ÓĿ¼ÀïµÄ¡£
ls -lR| grep "^d" | wc -l
¼òҪ˵Ã÷£º
ls -l
³¤ÁбíÊä³ö¸ÃĿ¼ÏÂÎļþÐÅÏ¢(×¢ÒâÕâÀïµÄÎļþ£¬²»Í¬ÓÚÒ»°ãµÄÎļþ£¬¿ÉÄÜÊÇÄ ......
ÎÒÓÃvsftpd-2.0.5.tar.gz°²×°vsftpd£¬ÔÚ/etc/init.dÀïÃæûÓÐvsftpd·þÎñ£¡
#service vsftpd start ²»ÐÐ
#/etc/init.d/vsftpd start ²»ÐÐ
Ö»ÄÜÕâÑùÆô¶¯£º#/usr/local/sbin/vsftpd &
ÎÒÒª¿ª»úÆô¶¯¾ÍÖ»ÄÜÔÚ/etc/rc.d/rc.local ÖмÓÈëÄÚÈÝ¡£
ÎÒ°ÑvsftpdÌí¼Óµ½·þÎñÀïÃæ
ÕâÑù²Ù×÷£º
1¡¢copyÒ»¸övsftpdÒ»¸öÆô¶¯½Å± ......