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

Linuxϵͳ¹ÜÀí


ϵͳÐÅÏ¢
uptime
uptime ¸ø³öÏÂÁÐÐÅÏ¢µÄÒ»ÐÐÏÔʾ. µ±Ç°Ê±¼ä, ϵͳÔËÐÐÁ˶à¾Ãʱ¼ä, µ±Ç°µÇ½µÄÓû§ÓжàÉÙ, ÒÔ¼°Ç°1,5ºÍ15·ÖÖÓϵͳµÄƽ¾ù¸ºÔØ.
Áª»úÐÅÏ¢-ʱ¼ä,ÏÔʾÈçÏÂ
11:27pm up 9 days, 7:12, 3 user, load average: 0.07, 0.12, 0.14
µ±Ç°ÏµÍ³Ê±¼ä ϵͳÔËÐÐʱ¼ä µ±Ç°ÔÚÏßÓû§Êý ϵͳ¸ººÉ 1·ÖÖÓÇ° 5 ·ÖÖÓÇ° 15 ·ÖÖÓÇ°
w
w – ÏÔʾÒѾ­µÇ¼µÄÓû§ÒÔ¼°ËûÃÇÔÚ×öʲô
w ÏÔʾ ϵͳÖÐ µ±Ç°Óû§ µÄ ÐÅÏ¢, ÒÔ¼° ËûÃÇ µÄ ½ø³Ì. µÚÒ»ÐÐ ÖÐ ÒÀ´Î ÏÔʾµ±Ç°Ê±¼ä, ϵͳµÄ³ÖÐøÔËÐÐʱ¼ä, µÇ¼µÄ Óû§Êý, ºÍ ×î½ü 1, 5, 15 ·ÖÖÓ µÄϵͳƽ¾ù¸ºÔØ (load average).
½Ó Ï À´ µÄ ÌõÄ¿ ÏÔʾ ÿλ Óû§ µÄ: µÇ¼Ãû, tty Ãû, Ô¶³ÌÖ÷»ú, µÇ¼ʱ¼ä,¿ÕÏÐʱ¼ä, JCPU, PCPU, ÒÔ¼°ËûÃÇ µ±Ç°½ø³Ì µÄ ÃüÁîÐÐ.
JCPU ʱ¼ä Ö¸ ij¸ö tty ÉÏ ËùÓÐ ½ø³Ì ÓõôµÄ ʱ¼ä, ²»°üÀ¨ ¹ýÈ¥µÄ ºǫ́ÈÎÎñ,µ«ÊÇ °üÀ¨ ÕýÔÚ ÔËÐÐ µÄ ºǫ́ÈÎÎñ.
PCPU ʱ¼ä Ö¸ µ±Ç°½ø³Ì ÓõôµÄ ʱ¼ä, ¿ÉÒÔ ÔÚ “what” Óò ¿´µ½ µ±Ç°½ø³Ì.
Áª»úÐÅÏ¢-ÒѵǼÓû§,ÏÔʾÈçÏÂ
01:04:10 up 1:34, 2 users, load average: 0.25, 0.16, 0.11
£¨uptime ÐÅÏ¢£©
USER TTY from LOGIN@ IDLE JCPU PCPU WHAT
user tty1 192.168.0.1 23:30 1:33 0.14s 0.12s-bash
Óû§Ãû µÇ¼·½Ê½ À´Ô´µØÖ· µÇ¼ʱ¼ä ·¢´ôʱ¼ä ×ÊÔ´Õ¼Óà µ±Ç°ÈÎÎñ
Tip:w [Óû§Ãû³Æ] : ÏÔʾijһÓû§Ïà¹ØÐÅÏ¢
who
Áª»úÐÅÏ¢,³£ÓòÎÊý
-r ÔËÐ춱ð
whoami
ÏÔʾµ±Ç°Óû§Ãû
last
last [-R] [-num] [ -n num ] [-adiox] [ -f file ] [name...] [tty...]
Last Ïòºó¼ìË÷ /var/log/wtmp Îļþ(Ò²¿ÉÒÔÓà -f Ñ¡ÏîÖ¸¶¨±»¼ìË÷µÄÎļþ)£¬²¢ÏÔʾ×ÔÕâ¸öÎļþ´´½¨ÒÔÀ´ËùÓеǼ£¨Í˳ö£©ÏµÍ³µÄÓû§ÁÐ±í¡£ÔÚÖ¸¶¨ÁËÓû§Ãû ºÍÖÕ¶ËÃûµÄÇé¿öÏ£¬last Ö»ÏÔʾ·ûºÏÕâЩ²ÎÊýµÄ¼Ç¼¡£Öն˵ÄÃû×Ö¿ÉÒÔ¼òд£¬Òò´Ëlast 0 µÈͬÓÚ last tty0.ÿ´ÎϵͳÖØÐÂÆô¶¯Ê±£¬ÐéÓû§ reboot ¶¼»á±»¼Ç¼µ½ÈÕÖ¾ÖС£Ëù ÒÔlast reboot»áÁгö×ÔÈÕÖ¾Îļþ´´½¨ÒÔÀ´µÄËùÓÐÖØÐÂÆô¶¯µÄÈÕÖ¾¼Ç¼¡£
Ñ¡Ïî
-numÖ¸¶¨ last ÒªÏÔʾ¶àÉÙÐС£
“-n num”µÈͬ -num.
-R²»ÏÔʾÖ÷»úÃûÁС£
-aÔÚ×îºóÒ»ÁÐÏÔʾÖ÷»úÃû. ºÍÏÂÒ»¸öÑ¡ÏîºÏÓÃʱºÜÓÐÓÃ
-d ¶Ô ÓڷDZ¾µØµÄµÇ¼£¬Linux ²»½ö±£´æÔ¶³ÌÖ÷»úÃû¶øÇÒ±£´æIPµØÖ·£¨IP number£©¡£Õâ¸öÑ¡Ïî¿ÉÒÔ½«IPµØÖ·£¨IP number£©×ª»»ÎªÖ÷»úÃû¡£
-iÕâ¸öÑ¡ÏîÀàËÆÓÚÏÔʾԶ³ÌÖ÷»ú IP µØÖ·£¨IP number£©µÄ -d Ñ¡Ï Ö»²»¹ýËüÓÃÊý×ֺ͵ã·ûºÅÏÔʾIPÊý
-o¶ÁÈ¡Ò»¸ö¾É¸ñʽµ


Ïà¹ØÎĵµ£º

Linux³ÌÐòÉè¼Æ ÖÕ¶Ë


¶ÔÖն˽øÐжÁд
ÔÚ±àд³ÌÐòʱ£¬ÎÒÃÇÍùÍùÐèÒª´ÓÖն˶ÁÈëÊý¾Ý¡£Ò»ÖÖÇé¿öÊÇÐèÒªÁ¬ÐøµØ¶ÁÈëÓû§¼üÈëµÄÑ¡ÔñÏÕâÍùÍù³öÏÖÔÚÊý¾Ý¿â³ÌÐòÖС£³ÌÐòÔ±ÍùÍù»áʹÓÃ
getchar
º¯ÊýÀ´¶ÁÈ¡Êý¾Ý£¬¼Ì¶øÅжÏÊäÈëµÄÊý¾ÝÊÇ·ñÓÐЧ£¬´Ó¶ø×ö³ö·´Ó¦¡£ÆäʵÈç´Ë×ö´øÓкܴóµÄ·çÏÕ£¬Ò»¸öʵÀý³ÌÐòÈçÏÂ
#include <stdio.h>
 
char *men ......

linuxÃæÊÔÌâ²Î¿¼´ð°¸£¨×ª£©


Ò»£®Ìî¿ÕÌ⣺
1. ÔÚLinuxϵͳÖУ¬ÒÔ Îļþ

·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ
/etc/fstab
ÖжÁÈ¡Òª¼ÓÔصÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓÃ
i½Úµã
À´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪÒýµ¼¿é ¡¢×¨ÓÃ¿é ¡¢ i½Úµã±í¿é ºÍÊý¾Ý´æ´¢¿é
¡£
5.
Á´½Ó·ÖΪ£º Ó²Á´½Ó ºÍ ·ûºÅÁ´½Ó
......

ʹÓÃtcmallocºóµÄMySQL·þÎñÆ÷±äÎȶ¨ÁË£¨Linux£©

֮ǰ£¬Ò»Ö±À§ÄպܾõÄMySQLµÄÎÊÌâÒòΪÓÐÁËtcmallocºóµÃÒÔ½â¾ö¡£
ÎÊÌâÊÇ£ºÍøÕ¾·ÃÎÊÁ¿²»¸ß£¬¸ß·åʱ²¢·¢ÊýÔÚ300-400Ö®¼ä¡£CPU±È½Ï¸ß£¬ÔÚ30-80%Ö®¼ä²¨¶¯µÃÀ÷º¦£¬Ê¹ÓÃtopÃüÁî¿ÉÒÔ¿´µ½ÊÇmysql½ø³Ìµ¼Ö£¬Í¬Ê±ÓÃiostatºÍsar²é¿´iowaitÖµºÜ¸ßÔÚ20-30Ö®¼ä¡£
µ«ÊÇϵͳ»¹¿ÉÒÔÎȶ¨ÔËÐУ¬È»ºóÖÜÆÚÐԵijöÏÖswap·ÖÇøÕ¼ÓÃÂÊÅÊÉý£¬Ö±½Óµ¼Ö ......

¿´¿´Ò»Î»Ç廪¼ÆËã»úרҵµÄѧÉúÔõô¿´LINUXÓëWINDOWS

±¾ÎÄÊÇһλÇ廪ÍËѧѧÉúËùд!ËûµÄÃû×Ö½ÐÍõÛó,È˺ܳöÃû£¬²»ÐÅGOOGLEһϾÍÖªµÀ£¡
ÎÒÒѾ­°ëÄêûÓÐʹÓà Windows µÄ·½Ê½¹¤×÷ÁË¡£Linux ¸ßЧµÄÍê³ÉÁËÎÒËùÓеŤ×÷¡£
GNU/Linux ²»ÊÇÿ¸öÈ˶¼ÏëÓõġ£Èç¹ûÄãÖ»ÐèÒª´¦ÀíÒ»°ãµÄÊÂÎñ£¬´òÓÎÏ·£¬ÄÇôÄã
²»ÐèÒªÁ˽âÏÂÃæÕâЩÁË¡£
ÎÒ²»ÊÇÒ»¸ö¿ñÈȵÄ×ÔÓÉÈí¼þ·Ý×Ó£¬ËäÈ»ÎÒºÜϲ»¶×ÔÓÉÈí¼þ¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ