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ÖÐtty¡¢
pty¡¢ptsµÄ¸ÅÄîÇø±ð
»ù±¾¸ÅÄ
1> tty(ÖÕ¶ËÉ豸µÄͳ³Æ):
ttyÒ»´ÊÔ´ÓÚ
Teletypes£¬»òÕßteletypewriters£¬ÔÀ´Ö¸µÄÊǵ紫´ò×Ö»ú£¬ÊÇͨ¹ý´®ÐÐÏßÓôòÓ¡»ú¼üÅÌͨ¹ýÔĶÁºÍ·¢ËÍÐÅÏ¢µÄ¶«Î÷£¬ºóÀ´ÕⶫÎ÷±»¼üÅÌ
ÓëÏÔʾÆ÷È¡´ú£¬ËùÒÔÏÖÔÚ½ÐÖն˱ȽϺÏÊÊ¡£
ÖÕ¶ËÊÇÒ»ÖÖ×Ö·ûÐÍÉ豸£¬ËüÓжàÖÖÀàÐÍ£¬Í¨³£Ê¹ÓÃttyÀ´ ......
À´Ô´£ºhttp://bbs.eeefan.com/viewthread.php?tid=1447
Linux - WineÉÏÔËÐÐMS Office 2007½Ì³Ì
Èý¸öÔÂÇ°,¹úÍâµÄWine ReviewС×éÊ״ν«Microsoft Office 2007ͨ¹ýWineÔËÐÐÔÚLinuxÉÏ.
²»¹ýÒòΪ·½·¨Òì³£·³Ëö,×÷Õßû°Ñ·½·¨¹«²¼³öÀ´.ÏÖÔÚ,Ëæ×ÅWineµÄ²»¶Ï½ø²½,ÈκÎÈ˶¼¿ÉÒÔ·½±ãµØ½«Microsoft Office 2007ÔËÐÐÔÚLinuxÉÏÁË!
ÏëÔ ......
linuxµÄechoÃüÁî, ÔÚshell±à³ÌÖм«Îª³£ÓÃ, ÔÚÖÕ¶ËÏ´òÓ¡±äÁ¿valueµÄʱºòÒ²Êdz£³£Óõ½µÄ, Òò´ËÓбØÒªÁ˽âÏÂechoµÄÓ÷¨
echoÃüÁîµÄ¹¦ÄÜÊÇÔÚÏÔʾÆ÷ÉÏÏÔʾһ¶ÎÎÄ×Ö£¬Ò»°ãÆðµ½Ò»¸öÌáʾµÄ×÷Óá£
¸ÃÃüÁîµÄÒ»°ã¸ñʽΪ£º echo [ -n ] ×Ö·û´®
ÆäÖÐÑ¡Ïîn±íʾÊä³öÎÄ×Öºó²»»»ÐУ»×Ö·û´®ÄܼÓÒýºÅ£¬Ò²Äܲ»¼ÓÒýºÅ¡£ÓÃechoÃüÁîÊä³ö¼ÓÒýº ......
·½·¨Ò» È¥µôPCÀ®°ÈµÄÇý¶¯Ä£¿é
#rmmod pcspkr ÒѲâÊÔ
¿ÉÒÔ½«ÃüÁîдµ½ /etc/rc.local ÕâÑùÏ´ÎϵͳÆô¶¯µÄʱºò¾Í»áÈ¥µôpcspkrÄ£¿éÁË¡£
Õû¸öÊÀ½ç¶¼Çå¾²ÁË£¡
·½·¨¶þ ÐÞ¸Ä /etc/inputrc Îĵµ
½« set bell-style none ÃüÁîÐм¤»î£¬ÖØÆôϵͳ¡£
ÍƼö·½·¨¶þ ......
ÌÚѶ¿Æ¼¼Ñ¶£¨ÂåÂåºÓ£© 5ÔÂ20ÈÕÏûÏ¢£¬ºìñ£¨Red Hat£©Ðû²¼ÒÑÔÚ¹úÄÚÆô¶¯´óѧÉúLinux¼¼ÄÜ´óÈü£»²¢½«Í¨¹ý³õÈü¡¢¸´Èü¡¢¾öÈü²ã²ãÑ¡°Î£¬ÓÚ7ÔÂ17ÈÕ¾ö³ö»ñʤÕß¡£
ºìñÖйúÊг¡²¿×ܼà¶ÐÁÒÒ±íʾ£¬¹úÄÚLinuxÊг¡È˲Åȱ¿ÚºÜ´ó£¬ÒѾӰÏìµ½Á˺ܶàLinuxÏîÄ¿µÄÕý³£½øÐУ¬Ï£Íûͨ¹ýÕâЩ¾Ù´ëÔö¼Ó´óѧÉú¶ÔLinuxµÄÐËȤ£¬´Ó¶øÅàÑø¸ü¶àÈ˲š£
Ìî ......