Linux ÌØÊâÎļþ£¨1£©——É豸Îļþ
Ò»¡¢É豸Îļþ
¡¡¡¡LinuxϵÄ/dev Ŀ¼ÖÐÓдóÁ¿µÄÉ豸Îļþ¡£Ö÷ÒªÊÇ¿éÉ豸ÎļþºÍ×Ö·ûÉ豸Îļþ¡£¡¡¡¡¿éÉ豸Îļþ¡¡¡¡ÔÚ¹ýÈ¥£¬ÔÚÌí¼ÓдÅÅ̺ó£¬ÍùÍùÐèÒªÊÖ¶¯Ôö¼Ó¿éÉ豸Îļþ¡£ÏÖÔÚͨ³£ÎÒÃDz»ÐèÒªÊÖ¶¯Ôö¼Ó¿éÉ豸Îļþ£¬ÔËÐÐÒ»ÏÂservice kudzu start £¬ÏµÍ³¾Í»á×Ô¶¯ÎªÄúÅäÖÃÏàÓ¦µÄÉ豸¡£¿éÉ豸µÄÖ÷ÒªÌØµãÊÇ¿ÉÒÔËæ»ú¶Áд£¬¶ø×î³£¼ûµÄ¿éÉ豸¾ÍÊÇ´ÅÅÌ£¬Èç/dev/hda1 ¡¢/dev/sda2¡¢/dev/fd0µÈ¡£¡¡¡¡×Ö·ûÉ豸Îļþ¡¡¡¡Í¬¿éÉ豸һÑù£¬ÎÒÃÇÒ»°ã¶¼¿ÉÒÔÓÃservice kudzu startÃüÁîÀ´×Ô¶¯Ôö¼Ó¡¢É¾³ý»òÐÞ¸Ä×Ö·ûÉ豸¡£×î³£¼ûµÄ×Ö·ûÉ豸ÊÇ´òÓ¡»úºÍÖÕ¶Ë£¬ËûÃÇ¿ÉÒÔ½ÓÊÜ×Ö·ûÁ÷¡£¡¡¡¡/dev/nullÊÇÒ»¸ö·Ç³£ÓÐÓõÄ×Ö·ûÉ豸Îļþ£¬ËÍÈëÕâ¸öÉ豸µÄËùÓж«Î÷¶¼±»ºöÂÔ¡£Èç¹û½«ÈκγÌÐòµÄÊä³ö½á¹ûÖØ¶¨Ïòµ½/dev/null£¬Ôò¿´²»µ½ÈκÎÊä³öÐÅÏ¢¡£ÉõÖÁÓÚ£¬Äú¿ÉÒÔ½«Ä³Ò»Óû§µÄshellÖ¸Ïò/dev/null¡¡ÒÔ½ûÖ¹ÆäµÇ½¡£¡¡¡¡¹ÜµÀÉ豸Îļþ¡¡¡¡¹ÜµÀÉ豸ÎļþÓÐʱºòÒ²±»½Ð×öFIFOÎļþ(FIFOÊÇÏȽøÏȳöµÄÒâ˼)£¬´Ó×ÖÃæÉÏÀí½â£¬¹ÜµÀÉ豸Îļþ¾ÍÊÇ´ÓһͷÁ÷È룬´ÓÁíһͷÁ÷³ö¡£Í¨³£ÎÒÃÇ»áÔÚÆäÖÐ×öһЩ¹¤×÷£¬ÒÔ´ïµ½ÎÒÃÇ“³ÔµÄÊDzݣ¬¼·³öÀ´µÄÊÇÄÌ”µÄÄ¿µÄ£¬¹ÜµÀÎļþÒ²ÓÐÆäÃîÓᣡ¡¡¡ÒÔǰ£¬Unixϵͳ¶ÔÎļþµÄ×î´óÓÃÁ¿ÓÃ2GBµÄÏÞÖÆ£¬ËäÈ»ÏÖÔÚа汾µÄLinux¡¢Solaris¡¢FreeBSDµÈ²»ÔÙÓдËÏÞÖÆ£¬µ«´¦Àí´óÎļþµÄÐèÇóÈÔÈ»´æÔÚ£¬¼ÙÉèÄúÏëÓþµÏñ(ddÃüÁî)µÄ·½Ê½À´±¸·ÝÒ»¸öÈÝÁ¿Îª20GB·ÖÇøµÄ·ÖÇø£¬¾Í»á²úÉúÒ»¸ö20GBµÄÎļþ£¬¸ù¾ÝÄú´ÅÅÌʵ¼ÊµÄʹÓÃ×´¿ö£¬Õâ¸öÎļþÔÚѹËõºó¿ÉÄÜÖ»ÓÐÊýMBµ½ÊýGB,ÎÒÃÇ¿ÉÒÔ½¨Á¢Ò»¸ö¹ÜµÀÎļþÀ´×Ô¶¯ÊµÏÖÕâ¸öѹËõ¹ý³Ì¡£¡¡¡¡[root@linux236 root]# mknod mypipe p
¡¡¡¡[root@linux236 root]# ls -l mypipe
¡¡¡¡prw-r--r-- 1 root root 0 Aug 5 23:27 mypipe
¡¡¡¡[root@linux236 root]#¡¡¡¡ÔÚÕâÀÎÒÃǽ¨Á¢ÁËÒ»¸ö½ÐmypipeµÄ¹ÜµÀÎļþ£¬ÓÃls -l ÃüÁî¿ÉÒÔ¿´µ½ËüµÄÊôÐÔÊÇprw-r--r--£¬ÓÃÏÂÃæµÄ×éºÏÃüÁîʵÏÖ¾µÏñºÍѹËõ£º¡¡¡¡[root@linux236 root]# compress < mypipe > sda6.img.Z &
¡¡¡¡[root@linux236 root]# dd if=/dev/sda6 of=mypipe
¡¡¡¡[root@linux236 root]# ls sda6.img.Z
¡¡¡¡sda6.img.Z¡¡¡¡µÚÒ»¸öÃüÁîʹµÃ´Ómypipe¹ÜµÀÖÐÁ÷³öµÄÎļþ±»Ñ¹ËõΪsda.img.ZÎļþ£¬×¢ÒâÕâ¸öÃüÁîµÄ½áβ±ØÐëʹÓÃ"&"·ûºÅ¡£µÚ¶þ¸öÃüÁ/dev/sda6·ÖÇøÖеÄ×ÊÁϵÀÈë¹ÜµÀÎļþmypipe£¬»»¾ä»°Ëµ£¬/dev/sda6·ÖÇøÖеÄÊý¾Ý½øÈë¹ÜµÀ£¬¶øÑ¹ËõÎļþsda6.img.ZÎļþ´Ó¹ÜµÀÖÐÁ÷³ö¡£¡¡¡¡ÔÚµ¼³öOracle¡¢DB2µÈ´óÐÍÊý¾Ý¿â
Ïà¹ØÎĵµ£º
±¾ÎÄÍøÖ·:http://bbs.bitscn.com/72875 ¸´ÖÆ
1. Linux ½Å±¾±àд»ù´¡
1.1 Óï·¨»ù±¾½éÉÜ
1.1.1 ¿ªÍ·
³ÌÐò±ØÐëÒÔÏÂÃæµÄÐпªÊ¼£¨±ØÐë·ÅÔÚÎļþµÄµÚÒ»ÐУ©£º
#!/bin/sh
¡¡ ·ûºÅ#!ÓÃÀ´¸æËßϵͳËüºóÃæµÄ²ÎÊýÊÇÓÃÀ´Ö´ÐÐ ......
ÔÚ
linux
ϵͳÖУ¬
TCP/IP
ÍøÂçÊÇͨ¹ýÈô¸É¸öÎı¾Îļþ½øÐÐÅäÖõģ¬ÐèÒª±à¼ÕâЩÎļþÀ´Íê³ÉÁªÍø¹¤×÷¡£ÏµÍ³ÖÐÖØÒªµÄÓйØÍøÂçÅäÖÃÎļþΪ£º
¡ô
/etc/sysconfig/network
¡ô
/etc/HOSTNAME
¡ô
/etc/hosts
¡ô
/etc/services
¡ô
/etc/host.conf
¡ô
/etc/nsswitch.conf
¡ô
/etc/resolv.conf
¡ô
/etc/r ......
Description of the "runinfo" format
-----------------------------------
Purpose of the "runinfo" files
------------------------------
"runinfo" files found in the source tree allow the "rtai-load" script
(see rtai-core/scripts/rtai-load) to retrieve the information it needs
to execute a RTAI ......
´´½¨Ð½ø³Ì£ºforkº¯Êý
1.1.1. forkº¯Êý¸Éʲô£¿
#include <sys/types.h>
#include <unistd.h>
pid_t fork(void);
‘fork()’º¯ÊýÓÃÓÚ´ÓÒÑ´æÔÚ½ø³ÌÖд´½¨Ò»¸öнø³Ì¡£Ð½ø³Ì³ÆÎª×Ó½ ......
LinuxÏ¿ÉÒÔÓÃls –l ÃüÁîÀ´ÅжÏÎļþÀàÐÍ£¬ÈçÉÏ Í¼Ëùʾ¡£¿ÉÒÔÒÀ¾ÝµÚÒ»ÁÐÖеÄ10¸ö×Ö·ûÀ´Åжϡ£
¡¡¡¡• -rw-r—r—Ö¸Ã÷ÁË1.txtÎļþÊÇÒ»¸öÆÕͨÎļþ£¬1.txtºÍmyprog04Îļþ¶¼ÊÇÆÕͨÎļþ¡£ÒÔ”-“¿ªÍ·µÄ¶¼ÊÇÆÕͨÎļþ£¬¶øÒÔ”d”¿ªÍ·µÄÊÇĿ¼Îļþ¡£
¡¡¡¡• brw-rw---- Ö¸Ã÷ÁË/dev/sd ......