³£ÓõÄLinuxÃüÁî
1.²é¿´ÏµÍ³ÄÚºË
#uname -a
2.²é¿´cpuÐÅÏ¢
#cat /proc/cpuinfo
3.²é¿´ÄÚ´æʹÓÃÇé¿ö
#free -m
4.²é¿´Ó²ÅÌÊ£Óà¿Õ¼ä
#df -h
5.²é¿´Ä¿Â¼Õ¼Óÿռä
#du -hs Ŀ¼Ãû
6.²é¿´µ±Ç°ÓÐÄÄЩ½ø³Ì
#ps -A
7.²é¿´µ±Ç°½ø³ÌµÄʵʱÇé¿ö
#top
8.²é¿´½ø³Ì´ò¿ªµÄÎļþ
#lsof -p
9.²é¿´Ä³¸öÎļþ±»ÄÄЩӦÓóÌÐò¶Áд
#lsof ÎļþÃû
10.²é¿´µ±Ç°¼àÌý80¶Ë¿ÚµÄ³ÌÐò
#lsof -n -i :80
11.¿ìËÙ²éÕÒij¸öÎļþ
#whereis filename
12.ÏÔʾxxxÎļþµ¹Êý6ÐеÄÄÚÈÝ
#tail -n 6 xxx
13.²éÕÒ°üº¬xxx×Ö·û´®µÄÎļþ
#grep -l -r xxx
14.ͳ¼Æµ±Ç°Îļþ¸öÊý
#ls /usr/bin|wc -w
15.½«±¾µØÎļþ¿½±´µ½·þÎñÆ÷ÉÏ
#scp -rp /path/filename username@remoteIP:/path
16.½«Ô¶³ÌÎļþ´Ó·þÎñÆ÷ÏÂÔص½±¾µØ
#scp -rp username@remoteIP:/path/filename/path
[
Ïêϸ½²½âÏÂscp
Ê×Ïȼì²ésshd·þÎñÊÇ·ñÆô¶¯£º
#ps -aux | grep sshd /usr/sbin/sshd
Èç¹ûûÓÐÆô¶¯£¬Ê¹ÓÃÃüÁîÆô¶¯sshd·þÎñ£º
#service sshd start
È»ºóʹÓÃÒÔÉÏÁ½¸öÃüÁî½øÐд«Ê䣬Èç¹û´«Êäʧ°Ü£¬¼ì²éetc/ssh/sshd_configÎļþÖÐ PermitRootLoginyesrootsshÏîÊÇ·ñΪyes
]
17.²é¿´CPUʹÓÃÇé¿ö
#top|grep CPU
18.²é¿´ÄÚ´æʹÓÃÇé¿ö
#top|grep Mem
19.ͳ¼Æ½ø³ÌÊý
#ps -aux|wc –l
20.²é¿´¹ÒÔØÐÅÏ¢
#mount –l
21.²é¿´locale
#locale
22.²éÕҶ˿ںÅËù¶ÔÓ¦µÄ½ø³ÌºÅ
#netstat –ntlp
23.²é¿´µ±Ç°ÏµÍ³×Ô¶¯Æô¶¯µÄ·þÎñ£¬Æô¶¯×´Ì¬·ÅÔÚ/etc/inittabÎļþÖÐ
#chkconfig –list
1. lnÈíÁ´½ÓºÍÓ²Á´½ÓµÄÇø±ð£ºÈíÁ´½ÓÏ൱ÓÚ¿ì½Ý·½Ê½£¬Ó²Á´½ÓÕ¼´ÅÅÌ¿Õ¼ä´óСÓëÔÎļþÏàͬ
2. suÓësu-µÄÇø±ð£ºsu-¼Ì³ÐÁËrootµÄϵͳ±äÁ¿£¬su²»¼Ì³Ð
3. ext2Óëtxt3Çø±ð£ºext2ÎÞÈÕÖ¾¹¦ÄÜ£¬±ÀÀ£ºóÖØÐÂÆô¶¯Âý
4. GRUBÓëLILOµÄÇø±ð£ºLILOµÄ/boot·ÖÇø²»ÄÜ·ÖÔÚ³¬¹ý1024ÖùÃæµÄµØ·½£¬´óÔ¼ÊÇÔÚ8.4G×óÓҵĵط½
5. GRUBµÄÆô¶¯ÅäÖÃÎļþ£º/boot/grub/menu.lst
6. ÍøÂçÅäÖÃĿ¼ /etc/sysconfig/network
7. Íø¿¨ÅäÖÃÎļþ ifcfg-1o
8. DNSÎļþ /etc/resolv.conf
9. hostÎļþ /etc/hosts
10. ·þÎñÎļþ /etc/service
11.RHELÏà¹Ø£º
°ü¹ÜÀíÆ÷£ºsystem-config-packages
Ô¶³Ì°²×°£ºlinux vnc vncpassword=faint123
Ô¶³Ì¹Ø±Õ·À»ðǽ£ºsetup
------------------------------------------------
ÕÒ³öÓû§¼°ÆäϵͳµÄÃû×Ö
[root@localhost ~]# whoami &nbs
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
¡¡¡¡Linux×÷Ϊһ¸ö¶àÈÎÎñ»·¾³£¬ÔÊÐíÓû§Í¬Ê±Ö´ÐжàÏîÈÎÎñ£¬ÀýÈç²é¿´ÏµÍ³Çé¿ö¡¢±¸·Ý×ÊÁÏ¡¢±à¼ÎļþºÍ´òÓ¡ÎļþµÈ¡£
¡¡¡¡¶ÔÓÚºÄʱ³¤µÄÈÎÎñ²»Ó¦¸ÃÈÃËüÔÚǰ̨ÈÎÎñÖÐÖ´ÐУ¬¶øÓ¦¸Ã½»¸øºǫ́ÈÎÎñÈ¥Ö´ÐС£ÕâÑùǰ̨ÈÎÎñ¿É¼ÌÐøÕý³£ÔË×÷ÆäËüµÄ²Ù×÷£¬²»Óõȴý¡£Ê¾ÀýÈçÏ£º
¡¡¡¡# find / -name testing &
¡¡¡¡# fg
¡¡¡¡Èç¹ûÏëÒ ......
1) ÓÀ¾ÃÐÔÉúЧ£¬ÖØÆôºó²»»á¸´Ô
¿ªÆô£º chkconfig iptables on
¹Ø±Õ£º chkconfig iptables off
2) ¼´Ê±ÉúЧ£¬ÖØÆôºó¸´Ô
¿ªÆô£º service iptables start
¹Ø±Õ£º service iptables stop
ÐèҪ˵Ã÷µÄÊǶÔÓÚLinuxϵÄÆäËü·þÎñ¶¼¿ÉÒÔÓÃÒÔÉÏÃüÁîÖ´ÐпªÆôºÍ¹Ø±Õ²Ù×÷¡£
ÔÚ¿ªÆôÁË·À»ðǽʱ£¬×öÈçÏÂÉèÖ㬿ªÆôÏà¹Ø¶Ë¿Ú£¬ ......
http://club.topsage.com/thread-1201128-1-1.html
ºÜ¶àÈ˶¼¶Ô¹ýÃüÁîÐÐÌáʾµÄÖØÒªÐÔ²»Ð¼Ò»¹Ë£¬ÉõÖÁÊÇÒ»µã¶¼²»¹ØÐÄ¡£µ«ÊÇÎÒÈ´Ò»µã¶¼²»ÕâôÈÏΪ£¬Ò»¸öºÃµÄÃüÁîÐÐÌáʾ¿ÉÒԸıäÄãʹÓÃÃüÁîµÄ·½Ê½¡£Îª´Ë£¬ÎÒÔÚinternetÉÏÕÒµ½Ò»Ð©·Ç³£ÊµÓã¬ÓÅÐ㣬²¢ÓÐȤµÄbashµÄÃüÁîÐÐÌáʾ¡£ÏÂÃæÎÒ½«ÎÒ×îϲ»¶Ê¹ÓõÄһЩÃüÁîÐÐÌáʾÂÞÁÐÈçÏ¡£
¡¡¡ ......
ÕâÊÇCµÄÔ³ÌÐò
#include <stdio.h>
#include <regex.h>
int main(int argc, char** argv)
{
regex_t reg;
regmatch_t pm[10];
char *pattern;
char buf[50];
const size_t nmatch = 10;
pattern = argv[1];
int result = regcomp(®, pattern, REG_EXTENDED);
while( fgets ......