RedHat linuxÍøÂçÅäÖÃÎļþÏê½â
ÖØÐÂÆô¶¯ÍøÂçÉèÖãº
£¯sbin/service network restart
ÊÊÓûúÐÍ:
ËùÓзþÎñÆ÷
ÎĵµÄÚÈÝ£º
Òª½¨Á¢Ò»¸öLinux·þÎñÆ÷¾ÍÊ×ÏÈÒªÁ˽âLinux»·¾³ÏºÍÍøÂç·þÎñÏà¹ØµÄÅäÖÃÎļþµÄº¬Òå¼°ÈçºÎ½øÐа²È«µÄÅäÖá£ÔÚLinuxϵͳÖÐ,TCP/IPÍøÂçÊÇͨ¹ýÈô¸É¸öÎı¾Îļþ½øÐÐÅäÖõģ¬Ò²ÐíÄãÐèÒª±à¼ÕâЩÎļþÀ´Íê³ÉÁªÍø¹¤×÷£¬ÏÂÃæ½éÉܼ¸¸ö»ù±¾µÄTCP/IPÍøÂçÅäÖÃÎļþ¡£
1./etc/sysconfig/network-scripts/ifcfg-<interface-name>Îļþ
ÔÚ
RedHatÖУ¬ÏµÍ³ÍøÂçÉ豸µÄÅäÖÃÎļþ±£´æÔÚ/etc/sysconfig/network-scriptsĿ¼Ï£¬ifcfg-eth0°üº¬µÚÒ»¿éÍø
¿¨µÄÅäÖÃÐÅÏ¢£¬ifcfg-eth1°üº¬µÚ¶þ¿éÍø¿¨µÄÅäÖÃÐÅÏ¢¡£ÔÚÆô¶¯Ê±£¬ÏµÍ³Í¨¹ý¶ÁÈ¡Õâ¸öÅäÖÃÎļþ¾ö¶¨Ä³¸öÍø¿¨ÊÇ·ñÆô¶¯ºÍÈçºÎÅäÖá£
ÏÂÃæÊÇ/etc/sysconfig/network-scripts/ifcfg-eth0ÎļþµÄʾÀý£º
DEVICE=eth0
IPADDR=192.168.0.2
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
ONBOOT=yes
BOOTPROTO=none
GATEWAY£½192.168.0.1
ÈôÏ£ÍûÊÖ¹¤ÐÞ¸ÄÍøÂçµØÖ·»òÔö¼ÓеÄÍøÂçÁ¬½Ó£¬¿ÉÒÔͨ¹ýÐ޸ĶÔÓ¦µÄÎļþifcfg-<interface-name>»ò´´½¨ÐµÄÎļþÀ´ÊµÏÖ¡£
DEVICE=<name>¡¡¡¡¡¡ <name>±íʾÎïÀíÉ豸µÄÃû×Ö
IPADDR=<address>¡¡¡¡¡¡ <address>±íʾ¸³¸ø¸ÃÍø¿¨µÄIPµØÖ·
NETMASK=<mask>¡¡¡¡ <mask>±íʾ×ÓÍøÑÚÂë
BROADCAST=<address>¡¡ <address>±íʾ¹ã²¥µØÖ·
ONBOOT=yes/no¡¡¡¡ Æô¶¯Ê±ÊÇ·ñ¼¤»î¸Ã¿¨
BOOTPROTO=none none£ºÎÞÐëÆô¶¯ÐÒé
bootp£ºÊ¹ÓÃbootpÐÒé
¡¡¡¡ dhcp£ºÊ¹ÓÃdhcpÐÒé
GATEWAY=<address> <address>±íʾĬÈÏÍø¹Ø
MACADDR=<MAC-address> <MAC-address>±íʾָ¶¨Ò»¸öMACµØÖ·
USERCTL=yes/no¡¡¡¡¡¡¡¡ ÊÇ·ñÔÊÐí·ÇrootÓû§¿ØÖƸÃÉ豸
2./etc/resolv.confÎļþ
Îļþ/etc/resolv.confÅäÖÃDNS¿Í»§¶Ë£¬Ëü°üº¬ÁËDNS·þÎñÆ÷µØÖ·ºÍÓòÃûËÑË÷ÅäÖã¬Ã¿Ò»ÐÐÓ¦°üº¬Ò»¸ö¹Ø¼ü×ÖºÍÒ»¸ö»ò¶à¸öµÄÓÉ¿Õ¸ñ¸ô¿ªµÄ²ÎÊý¡£ÏÂÃæÊÇÒ»¸öÀý×ÓÎļþ£º
search wuxp.com
nameserver 192.168.0.1
nameserver 192.168.0.2
search
wuxp.com:±íʾµ±ÌṩÁËÒ»¸ö²»°üÀ¨ÍêÈ«ÓòÃûµÄÖ÷»úÃûʱ£¬ÔÚ¸ÃÖ÷»úÃûºóÌí¼Ówuxp.comµÄºó׺£»
nameserver:±íʾ½âÎöÓòÃûʱʹÓøõØÖ·Ö¸¶¨µÄÖ÷»úΪÓòÃû·þÎñÆ÷¡£ÆäÖÐÓòÃû·þÎñÆ÷ÊÇ°´ÕÕÎļþÖгöÏÖµÄ˳ÐòÀ´²éѯµÄ¡£Òò´Ë£¬Ó¦¸ÃÊ×Ïȸø³ö×î¿É¿¿µÄ·þ
ÎñÆ÷¡£Ä¿Ç°£¬ÖÁ¶àÖ§³ÖÈý¸öÃû×Ö·þÎñÆ÷¡£
3./etc/sysconfig/networkÎļþ
¸ÃÎļþÓÃÀ´Ö¸¶¨·þÎñÆ÷
Ïà¹ØÎĵµ£º
gccµÄ±àÒë¹ý³Ì·ÖΪËIJ½£¬·Ö±ðΪ£º
(1)Ô¤±àÒë (Pre-Processing)
(2)±àÒë (Compiling)
(3)»ã±à (Assembling)
(4)Á´½Ó (Linking)
ÒÔhello.cΪÀý˵Ã÷£º
#include<stdio.h>
int main(void)
{
printf("Hello World!");
return 0;
}
(1)Ô¤±àÒë½×¶Î (Pre-Processing)
&nbs ......
×î½ü£¬¿ªÊ¼ÑжÁÒ»ÏÂLinuxµÄÄں˴úÂ룬¸ÕÒ»¿ªÊ¼£¬¾ÍÓÐÁîÈ˾ªÌ¾µÄ·¢ÏÖ£¬²»µÃ²»¸Ð̾Äں˴úÂëÉè¼ÆµÃÖ®ÃÀ£¡µ¥ÊÇ×î³£ÓõÄÁ´±íÒ²Éè¼ÆµÃ²»µÃ²»ÁîÈËÅå·þ£¡
1.1.Á´±ílist_head
include/linux/list.h
ºÜ¾µä£¬Á´±íÔÚÄÚºËÖкܳ£Óã¬ÀýÈç¹ÜÀí½ø³Ì£¬½ø³ÌµÄ¸÷¸ö״̬¶ÓÁж¼ÊÇʹÓÃÕâ¸öË«ÏòÁ ......
Linux®¼¼Êõ¡¢¿ª·¢Ä£ÐͺÍÉçÇø¶¼¶Ô IT Òµ²úÉúÁËÖØÒªµÄÓ°Ï죬ÎÒÃÇÄÜ×öµÄ¾ÍÊÇÕ¾µ½Ò»±ß¿´¿´ÕâЩ£¬ºÜ¸ßÐËÓë developerWorks Ò»Æð¶È¹ýÁ˵ÚÒ»¸ö 10 Äê¡£Linux ÍŶÓÒѾ½«ÕâЩ¶Ô Linux ²úÉúÖØ´óÓ°ÏìµÄÄÚÈÝÕûÀíµ½Ò»Æð¡£
¹ýÈ¥ 10 ÄêÀLinux ·¢ÉúÁËÌ«¶àµÄÊÂÇ飬ºÜÄÑÍêÕûµØÁгö¸Ã²Ù×÷ϵͳµÄÖØҪʼþºÍ¼¼Êõ¸Ä½ø¡£¾¡¹ÜÈç´Ë£¬ÎªÁËÇì× ......
http://blog.csdn.net/compiler_hdz/archive/2006/01/10/575113.aspx
ÏÈ¿´Ò»¸ö“hello world!”µÄÀý×Ó£º
ÔÚij¸öĿ¼ÏÂн¨Ò»¸öÎļþ£¬½Ðhello.sh£¬ÇÃÈëÒÔÏ´úÂ룺
#!/bin/sh
echo "hello world!"
ºÃ£¬¾ÍÕâЩ¡£±£´æ£¬ÔÚÃüÁîÌáʾ·ûϽøÈë±£´æ“hello.sh”µÄĿ¼£¬ÕâÑùÖ´ÐУº
......
Ïà¹Øº¯Êý
fork£¬execve£¬waitpid£¬popen
±íÍ·Îļþ
££i nclude<stdlib.h>
¶¨Ò庯Êý
int system(const char * string);
º¯Êý˵Ã÷
system()»áµ÷ÓÃfork()²úÉú×Ó½ø³Ì£¬ÓÉ×Ó½ø³ÌÀ´µ÷ÓÃ/bin/sh-c stringÀ´Ö´ÐвÎÊýstring×Ö·û´®Ëù´ú±íµÄÃüÁ´ËÃü>ÁîÖ´ÐÐÍêºóËæ¼´·µ»ØÔµ÷ÓõĽø³Ì¡£ÔÚµ÷ÓÃsystem()ÆÚ¼äSIGCHLD ÐÅ ......