Linux Shell ¡¶abs_guide¡· ѧϰ±Ê¼Ç(1)
µÚÒ»²¿·Ö
1.ΪʲôʹÓÃshell
Ä¿Ç°Á÷ÐеÄLinux shell ±»³Æ֮ΪBASH¡£¶ÔÓÚÈκÎÏëÊʵ±¾«Í¨Ò»Ð©¹ÜÀí֪ʶµÄÈËÀ´Ëµ£¬ÕÆÎÕshell½Å±¾¶¼ÊÇ×î»ù±¾µÄ£»shell½Å±¾×ñѵäÐ͵ÄUNIXÕÜѧ£¬¼È°Ñ´óµÄ¸´ÔӵŤ³Ì·Ö³ÉС¹æÄ£µÄ×ÓÈÎÎñ£¬²¢ÇÒ°ÑÕâЩ²¿¼þºÍ¹¤¾ß×éºÏÆðÀ´¡£
ʲôʱºò²»Ê¹ÓÃshell£º
×ÊÔ´Ãܼ¯ÐÍÈÎÎñ£¬ÓÈÆäÊÇÐèÒª¿¼ÂÇЧÂÊʱ¡££¨±ÈÈçÅÅÐò£¬hashµÈ£©£»
ÐèÒª´¦Àí´óÈÎÎñµÄÊýѧ²Ù×÷£¬ÓÈÆäÊǸ¡µãÔËËãµÈ£»
Óпçƽ̨ÐèÇóʱ£»
¸´ÔÓµÄÔËÓã¬ÔÚ±ØÐëʹÓýṹ»¯±à³Ìʱ£»
¶ÔÓ°Ïìϵͳȫ¾ÖÐԵĹؼüÈÎÎñÓ¦Óã»
¶ÔÓÚ°²È«ÓкܸßÒªÇóµÄÈÎÎñ£»
ÏîÄ¿ÓÉÁ¬´®µÄÒÀÀµµÄ¸÷¸ö²¿·Ö×é³É£»
ÐèÒª´ó¹æÄ£µÄÎļþ²Ù×÷£»
ÐèÒª¶àάÊý×éÖ§³Ö£»
ÐèÒªÊý¾Ý½á¹¹Ö§³Ö£¬±ÈÈçÁ´±í»òÊ÷µÈÊý¾Ý½á¹¹£»
ÐèÒª²úÉú»ò²Ù×÷GUI£»
ÐèÒªÖ±½Ó²Ù×÷ϵͳӲ¼þ£»
ÐèÒªI/O»òSocket½Ó¿Ú£»
ÐèҪʹÓÿâ»òÀÏ´úÂë½Ó¿Ú£»
˽È˵ģ¬±ÏÔ´µÄÓ¦ÓÃ(shell¾Í·ÅÔÚÎı¾ÎļþÖУ¬È«ÊÀ½ç¶¼¿´µÃµ½)¡£
Èç¹ûÄã·ûºÏÉϱߵÄÈκÎÒ»Ìõ£¬ÄÇôÇ뿼ÂǸüÇ¿´óµÄÓïÑÔ°É¡£
2.´ø×ÅÒ»¸öSha-Bang(#!)³ö·¢
ÔÚÒ»¸ö×î¼òµ¥µÄshellÖУ¬Ò»¸öshell scriptÆäʵ¾ÍÊÇһϵÁÐϵͳÃüÁîÁе½Ò»¸öÎļþÖУ¬×î»ù±¾µÄÓô¦¾ÍÊÇÔÚÄãÊäÈëÕâЩÌض¨ÃüÁîʱÄܹ»ÉÙÇÃһЩ×Ö¡£
Example 2-1£ºÇå³ý/var/logϵÄlogÎļþ
#######Start Strip#######
1 # Cleanup
2 # µ±È»ÒªÊ¹ÓÃrootÀ´ÔËÐÐÕâ¸ö½Å±¾
3
4 cd /var/log
5 cat /dev/null > message
6 cat /dev/null > wtmp
7 echo "Logs cleaned up"
#######End Script#######
Õâ¸ù±¾¾ÍûʲôϡÆæµÄ£¬Ö»²»¹ýÊÇÃüÁîµÄ¶Ñ»ý£»°ÑËùÓÐÃüÁî·Åµ½Ò»¸öÎļþÖУ¬ºÃ´¦ÊDz»ÓÃÿ´Î¶¼ÇÃËüÃÇ¡£ÏÂÃæÎÒÃÇÀ´¿´Ò»¸öÕæÕýÒâÒåÉϵĽű¾£¬¶øÇÒÎÒÃÇ¿ÉÒÔ×ߵøüÔ¶...
Example 2-2£ºcleanup£¬Ò»¸öÔöÇ¿µÄºÍ¹ãÒåµÄɾ³ýlogfileµÄ½Å±¾
#######Start Strip#######
1 #!bin/bash
2 # Ò»¸öbash½Å±¾µÄÕýÈ·µÄ¿ªÍ·
3
4 # Clean Version 2
5
6 LOG_DIR = /var/log
7 ROOT_UID = 0 #$UIDΪ0µÄʱºò£¬Óû§²Å¾ßÓиùÓû§µÄȨÏÞ
8 LINES = 50 #ĬÈϵı£´æÐÐÊý
9 E_XCD = 66 #²»ÄÜÐÞ¸ÄĿ¼£¿
10 E_NOTROOT = 67 #²»ÊǸùÓû§£¬Í˳ö
11
12 if [$UID -ne $ROOT_UID]
13 then
14 echo "Must be root user to run this script"
15 exit E_NOTROOT
16 fi
17
18 if [ -n "$1"] #²âÊÔÊÇ·ñÓÐÃüÁîÐвÎÊý£¨·Ç¿Õ£
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
×÷Õߣºsixth
Ò»¡¢LinuxµÄÆô¶¯Á÷³Ì
1. ´ÓBIOSµ½KERNEL
BIOS×Ô¼ì£>MBR(GRUB)£>KERNEL£>KERNEL×Ô½âѹ£>Äں˳õʼ»¯£>ÄÚºËÆô¶¯
2. ÄÚºËÆô¶¯£º´´½¨1££½ø³Ì²¢Ö´ÐУ¬ÓÉËü´´½¨Èô¸ÉÄÚºËỊ̈߳¨kernel thread£©£¬È»ºó×°Èë²¢Ö´ÐгÌÐò/sbin/init£¨±ä³ÉÒ»¸öÓû§½ø³Ì£©¡£´Ëºó£¬init¸ù¾Ý/etc/initt ......
À´Ô´: ChinaUnix²©¿Í ¡¡ÈÕÆÚ£º 2009.05.12 07:02¡¡(¹²ÓÐ0ÌõÆÀÂÛ) ÎÒÒªÆÀÂÛ
LinuxϵͳÆô¶¯Á÷³Ì
¿ªÊ¼-à³õʼ»¯BIOS-àÖ´ÐÐÆô¶¯¼ÓÔØÆ÷--àÔØÈëÄÚºË--àÆô¶¯init·þÎñ-à½áÊø
¿ªÊ¼£º
Á÷³Ì·ÖÎö£º
Ò»£º³õʼ»¯BIOS
1£º¼ì²âËùÓÐÍⲿÉ豸
2£ºÑ°ÕÒÆô¶¯´ÅÅÌ
¶þ£ºÖ´ÐÐÆô¶¯¼ÓÔØÆ÷
1£ºB ......
wget http://bu3sch.de/b43/fwcutter/bcm43xx-fwcutter-006.tar.bz2
tar xjf bcm43xx-fwcutter-006.tar.bz2
cd bcm43xx-fwcutter-006
make
cd ..
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
ÏÂÔز¢¹¹½¨×îеÄb43-fwcutter£º
wget http://bu3sch.de/b43/fwcutter/b43-fwcutter-011.tar.bz2
tar xjf b43-fwcutter-011.tar.b ......