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

Tips: linux shellÖض¨Ïò

Linux POSIX Shell »·¾³ÖÐÖ§³ÖÊäÈëÊä³öÖض¨Ïò£¬Ó÷ûºÅ"<"ºÍ">"À´±íʾ¡£ÃüÁîÐÎʽ¿ÉÒÔÓÃ%>file»òÕß%<contentÀ´±íʾ(ÆäÖÐ%±íʾÎļþÃèÊö·û£º0Ϊ±ê×¼ÊäÈëstdin£¬1Ϊ±ê×¼Êä³östdout¡¢2Ϊ±ê×¼´íÎóstderr).ϵͳĬÈÏ%ÖµÊÇ1£¬Ò²¾ÍÊÇ1>£¬¿ÉÒÔ¼òдΪ>£¬Ò²¾ÍÊÇ˵ĬÈÏΪ1>¡£stdoutµÄĬÈÏÊä³öµ½Öնˣ¬stderrµÄĬÈÏÊä³öÖÕ¶Ë.
ÉÏÊöÃüÁî¿ÉÒÔÓÃÀ´Ö¸¶¨ÐèÒªÖض¨ÏòµÄ±ê×¼ÊäÈë»òÊä³ö£¬±ÈÈç 2>a.txt ±íʾ½«´íÎóÐÅÏ¢Êä³öµ½Îļþa.txtÖС£
ͬʱ£¬»¹¿ÉÒÔÔÚÕâÈý¸ö±ê×¼ÊäÈëÊä³öÖ®¼äʵÏÖÖض¨Ïò£¬±ÈÈ罫´íÎóÐÅÏ¢Öض¨Ïòµ½±ê×¼Êä³ö£¬¿ÉÒÔÓà 2>&1À´ÊµÏÖ¡£
´ËÍ⣬LinuxÏ»¹ÓÐÎļþ/dev/null£¬ËùÓÐÖض¨Ïòµ½ËüµÄÐÅÏ¢¶¼»áÏûʧ¡£µ±ÎÒÃDz»ÐèÒª»ØÏÔ³ÌÐòµÄËùÓÐÐÅϢʱ£¬¾Í¿ÉÒÔ½«Êä³öÖض¨Ïòµ½/dev/null¡£¼ÙÈçÏëÒªÕý³£Êä³öºÍ´íÎóÐÅÏ¢¶¼²»ÏÔʾ£¬ÔòÒª°Ñ±ê×¼Êä³öºÍ±ê×¼´íÎó¶¼Öض¨Ïòµ½/dev/null£¬ ÀýÈ磺
# ls 1>/dev/null 2>/dev/null
»¹ÓÐÒ»ÖÖ×ö·¨Êǽ«´íÎóÖض¨Ïòµ½±ê×¼Êä³ö£¬È»ºóÔÙÖض¨Ïòµ½ /dev/null£¬ÀýÈ磺
# ls >/dev/null 2>&1
×¢Ò⣺´Ë´¦µÄ˳Ðò²»Äܸü¸Ä£¬ÏȽ«±ê×¼Êä³öÖض¨Ïòµ½ /dev/null£¬È»ºó½«±ê×¼´íÎóÖض¨Ïòµ½±ê×¼Êä³ö£¬ÓÉÓÚ±ê×¼Êä³öÒѾ­Öض¨Ïòµ½ÁË/dev/null£¬Òò´Ë±ê×¼´íÎóÒ²»áÖض¨Ïòµ½/dev/null¡£


Ïà¹ØÎĵµ£º

Linux shell±à³Ì


±¾ÎÄÍøÖ·:http://bbs.bitscn.com/72875 ¸´ÖÆ ¡¾×ª×Ôbbs.bitsCN.com¡¿
1. Linux ½Å±¾±àд»ù´¡
1.1 Óï·¨»ù±¾½éÉÜ
1.1.1 ¿ªÍ·
       ³ÌÐò±ØÐëÒÔÏÂÃæµÄÐпªÊ¼£¨±ØÐë·ÅÔÚÎļþµÄµÚÒ»ÐУ©£º
       #!/bin/sh
¡¡   ·ûºÅ#!ÓÃÀ´¸æËßϵͳËüºóÃæµÄ² ......

LinuxÏÂApache 2.2, MySQL 5.0ºÍPHP 5.0µÄ°²×°ÓëÅäÖÃ

¡¾×ª¡¿http://www.linuxsir.org/main/?q=node/241
1.°²×°»·¾³
²Ù×÷ϵͳ£ºRed Hat Linux Enterprise AS 4.0
Êý¾Ý¿â£ºMySQL 5.0.24
Web·þÎñÆ÷£ºApache 2.2.3
½Å±¾ÓïÑÔ£ºPHP 5.1.6
2.°²×°MySQL 5.0.24
-------------ÏÂÔØÈí¼þ°ümysql-5.0.24.tar.gz£¬µØÖ·http://www.mysql.com-------------
# tar zvxf mysql-5.0.24.ta ......

Linux ¹²Ïí¿â±à³Ì[ת]

Linux ¹²Ïí¿â±à³Ì
×÷ÕߣºÖÕÄÏ   <li.zhongnan@hotmail.com
>
1¡¢½éÉÜ
¶¯Ì¬¿âÊdzÌÐòÉè¼Æ³£Óõļ¼Êõ£¬²ÉÓö¯Ì¬¿â¿ÉÒÔÓÐЧµÄ¼õÉÙ³ÌÐò´óС£¬½ÚÊ¡¿Õ¼ä£¬Ìá¸ßЧÂÊ£¬Ôö¼Ó³ÌÐòµÄ¿ÉÀ©Õ¹ÐÔ£¬±ãÓÚÄ£¿é»¯¹ÜÀí¡£ÔÚWindowsºÍ
Linux²Ù×÷ϵͳÖж¼Óж¯Ì¬¿âµÄ¸ÅÄî¡£Windows½«Æä³ÆΪ¶¯Ì¬Á´½Ó¿â£¨Dynamic Link
Library£¬ ......

½ûÓÃlinuxÖÕ¶ËÖеı¨¾¯Éù

·½·¨Ò» È¥µôPCÀ®°ÈµÄÇý¶¯Ä£¿é
#rmmod pcspkr ÒѲâÊÔ
¿ÉÒÔ½«ÃüÁîдµ½ /etc/rc.local ÕâÑùÏ´ÎϵͳÆô¶¯µÄʱºò¾Í»áÈ¥µôpcspkrÄ£¿éÁË¡£
Õû¸öÊÀ½ç¶¼Çå¾²ÁË£¡
·½·¨¶þ ÐÞ¸Ä /etc/inputrc Îĵµ
½« set bell-style none ÃüÁîÐм¤»î£¬ÖØÆôϵͳ¡£
ÍƼö·½·¨¶þ ......

ʹÓÃputty+xmingÔ¶³Ì×ÀÃæ¹ÜÀílinuxϵͳ

£¨±¾ÎÄÔ­´´£¬×ªÔØÇë×¢Ã÷³ö´¦£¡£©
ÅäÖÃ
1.   putty ÉèÖÃ
      ssh->x11->enable x11 forwarding -> x display location £¨Ìîlocalhost£º15£¬´ËÊýÖµºÍxming ÉèÖÃÒ»Ö£©£¬ÆäËûʹÓÃsshЭÒéµÇ¼linux·þÎñÆ÷µÄÈí¼þ£¬ÈçsecureCRT£¬¶¼¿ÉÒÔºÍxming½øÐÐÕûºÏ¡£ÅäÖ÷½·¨ÀàËÆ¡£
2. &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ