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

ÔõÑù±àдLinux shell script(Ò»)

 ½üÀ´ÕýÔÚѧϰLinux shell script£¬Ö÷ÒªÊÇѧϰLinux Shell Scripting Tutorial (LSST) v1.05r3µÄ¼¸¸öÕ½ڣ¬µ«ÒòΪÊÇÓ¢ÎĵÄËùÒÔÕâÀï°ÑËü·­ÒëÏ£¬Ò²ÊÇ×Ô¼º¼ÓÉîÓ¡Ï󡣺ÃÁËÖ±½Ó½øÈëÖ÷Ìâ¡£
1.How to write shell script £¿
a.Ê×ÏÈÓÃÈκεıàÒëÆ÷£¨vi,vim,kwrite,....£©±àдһ¸öshell script£»
b.È»ºó°´ÕÕÏÂÃæµÄ·½·¨¸øÄã±àÒëµÄshell scriptÌí¼Ó¿ÉÖ´ÐÐÊôÐÔ£»
  chmod  Ìí¼Ó(ɾ³ý)ÊôÐÔ  ÎļþÃû³Æ
ÀýÈ磺
  chmod  +x   your_script_name »òÕß
  chmod  755 your_script_name
Àý×ÓÖеڶþÖз½·¨ÖÐ755±íʾ¶ÔÈý¸ö²»Í¬Àà±ðµÄʹÓÃÕßÉèÖÃÊôÐÔ£¬ÕâÀïÊ×ÏÈ´ó¼ÒÒªÖªµÀLinuxÖеijýÁË¿ÉÒÔÓÃr,w,x±íʾ¿É¶Á£¬¿Éд£¬¿ÉÖ´ÐеÄÊôÐÔÍ⣬»¹¿ÉÒÔÓÃÒ»¸öÊý×Ö´ú±íÒ»ÖÖÊôÐÔ£¬·Ö±ðÊÇr-4,w-2,x-1£¬Ò²¾ÍÊÇ4¾Í±íʾ¿É¶Á£¬2±íʾ¿Éд£¬1±íʾ¿ÉÖ´ÐУ»ÄÇôÈçºÎÉèÖÃÕâЩÊôÐÔÄØ£¿Èç¹ûÎÒÃÇÓó£¹æµÄ·½·¨ÊÇͨ¹ý“+¡¢-”·ûºÅÀ´ÉèÖõģ¬Ò²¾ÍÊÇ"+r"±íʾ¸øij¸öÎļþ¼ÓÉϿɶÁÊôÐÔ£¬"-r"±íʾ¸øij¸öÎļþÈ¥³ý¿É¶ÁÊôÐÔ£»
ÔÚÓÃÊý×Ö±íʾÖÐÊÇÕâÑùÉ趨ÊôÐԵģ¬ÓÃÊý×ÖÉ趨ÊôÐÔ¸ü¼ÓµÄ·½±ã¿ì½Ý£¬Ò»´Î¿ÉÒÔÉ趨Èý¸öÀà±ðʹÓÃÕßµÄÊôÐÔ“ÎļþÓµÓÐÕß”¡¢“ÎļþÓµÓÐÕßËùÔÚµÄ×é³ÉÔ±”¡¢“ÆäËüʹÓÃÕß”£¬ÉÏÃæµÄÀý×ÓÖУ¬7ÊǸøÎļþÓµÓÐÕßÉ趨µÄÊôÐÔ£¬ÄÇ"7"ÊÇʲôÒâ˼ÄØ£¿Æäʵ¾ÍÊǸ÷¸öÊôÐÔÊý×ÖÏà¼ÓµÄ½á¹û£¬Ò²¾ÍÊÇÈç¹ûÄãÒªÉ趨´ËÀàʹÓÃÕßÓÿɶÁ4,¿Éд2,¿ÉÖ´ÐÐ1,ÊôÐÔ£¬ÄÇô¾ÍÊÇ4+2+1 = 7£»´ÏÃ÷µÄÄã¿ÉÄÜÒѾ­ÖªµÀÁËÎļþÓµÓÐÕßËùÔÚµØ×é³ÉÔ±µÄÊôÐÔÊÇ ¿É¶Á ¿ÉÖ´ÐÐ ¼´£º4+1 = 5 £¬ÆäËüʹÓÃÕßµÄÊôÐÔÒ²ÊÇ ¿É¶Á ¿ÉÖ´ÐÐ ¼´£º4+1 = 5. ºÃÁËÊôÐÔÉ趨¾Í²»³¶ÁË£¬¹Ø¼üÊÇÒª¼ÇסchmodÃüÁî¡£
c.±àÒëºÃÁ˽ű¾ÒÔºó¾ÍÊÇÖ´ÐÐÁË
ÕâÀïÌṩÁ½ÖÖ·½·¨Ö´ÐÐÄãµÄ½Å±¾£º
  bash   your_script_name  #ÕâÀïµÄ“#”ºÅÖÐLinux shell scriptÖÐÊDZíʾÆäºóµÄÄÚÈÝΪעÊÍ£»bash ÊÇÎÒÃÇϵͳÖеÄshellÀàÐÍÕâÀï¾Í²»³¶Ô¶ÁË
  ./your_script_name  #½¨Òé´ó¼Ò¾ÍÖ±½ÓÓÓ./”½ÓÄãµÄ½Å±¾Ãû³ÆÖ´ÐУ¬ÎªÊ²Ã´²»ÄÜÏñWindowsÒ»ÑùÖ±½ÓÊäÎļþÃûÖ´ÐÐÄØ£¿Õâ¸öÎÊÌâÇë×Ô¼ºÕÒ´ð°¸
ºÃÁË£¬ÎÒÃÇÏÖÔÚ°ÑÉÏÃæµÄÁ¬¹á×öÒ»±é£»
Ê×ÏȽ¨Á¢Ò»¸ö½Å±¾£¬ÎÒÔÚÕâÀïʹÓÃvi±àÒëÆ÷¡£
$ vi first
ÄÚÈÝÈçÏ£º
#
# My first shell script
#
clear
echo "Knowledge is Power"
±£´æÍ˳ö£»
È»ºóÌí¼Ó¿ÉÖ´ÐÐÊôÐÔ£»
$ chmod 755 first
×îºóÖ´ÐÐ
$ ./fi


Ïà¹ØÎĵµ£º

Linux ´®¿ÚÉ豸

 
ÔÚLinuxÖÐÓÃttySxµÄÐÎʽÀ´±íʾ´®¿ÚÉ豸Ãû£¬Èç COM1±»±íʾΪttyS0£¬COM2±»±íʾΪttyS1£¬ÒÔ´ËÀàÍÆ¡£ÏÂÃæÕâ¸öÃüÁîÏÔʾϵͳÖб»¼ì²âµ½µÄ´®¿Ú£º
# dmesg | grep ttyS
[   25.942157] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[   25.942840] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) ......

ǶÈëʽ linux Ï ͨÓà console£¨¿ØÖÆ̨£© µÄʵÏÖ

Ç°ÑÔ£º
        µ±ÎÒÃÇʹÓÃǶÈëʽlinux ½øÐпª·¢Ê±£¬kernel ÅÜÆðÀ´Ö®ºó£¬ÎÒÃÇÏ£ÍûÄÜͨ¹ý´®¿Ú£¨±ê×¼ÊäÈë¡¢Êä³ö£©£¬ÔÚÓ¦ÓóÌÐòÕýÔÚÔËÐеĹý³ÌÖУ¬½øÐÐһЩµ÷ÊÔ¹¤×÷£¬ÀýÈ磬¶ÔCPUһЩ¼Ä´æ½øÐе÷Õû£¬ÒÔ¹Û²âµ÷ÕûÒÔºóµÄ½á¹û£¬²¢ÇÒ£¬µ±ÎÒÃÇÎÞ·¨°ÑÎÒÃǵÄÓ¦ÓóÌÐò·ÅÔÚºǫ́ÔËÐУ¬ÄÇôÎÒÃǾÍÐèÒªÊ ......

LinuxϵÄMakefile±Ê¼Ç

 À´Ô´linux-2.6.20.21/Documentation/kbuild/makefiles.txt
*  obj-y
+= foo.o ±íʾ±àbuild-in£¬obj-m += foo.o±íʾ±à³Émodule.
* kbuild
»á±àÒëËùÓеÄ$(obj-y)Îļþ£¬È»ºóµ÷ÓÃ$(LD) -r°ÑÕâЩÎļþºÏ²¢µ½Ò»¸öbuilt-in.oÎļþÖС£Õâ¸öbuilt-in.oÉÔºó»á±»¸¸¼¶Makefile linkµ½vmlinux
* ÓÃlib-y
:= checksum.o ......

linuxÏ°²×°gd¿â²¢ÇÒÖ§³Ösocket

Ò»¡¢ÏÂÔØ
gd-2.0.33.tar.gz http://www.boutell.com/gd/
jpegsrc.v6b.tar.gz http://www.ijg.org/
libpng-1.2.7.tar.tar http://sourceforge.net/projects/libpng/
zlib-1.2.2.tar.gz http://sourceforge.net/projects/zlib/
freetype-2.1.9.tar.gz http://sourceforge.net/projects/freetype/
php-4.3.9.tar.g ......

linuxÏÂfile descriptoerÏÞÖÆ


linuxÏÂfile descriptoerÏÞÖÆ
ĬÈÏ·ÖÀà   2009-11-21 14:47   ÔĶÁ0   ÆÀÂÛ0  
×ֺţº ´ó´ó  ÖÐÖР СС
Tuning file descriptor limits on Linux
Linux limits the number of file descriptors that any one process may open; the default limits are 1024 p ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ