Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÉÏ´ò°üwgzºÍwgt widgetÏîÄ¿

shell½Å±¾Ô´Âë: widget.sh #!/bin/bash
####################±äÁ¿¶¨Òå####################
shellroot=/var/shell
shdir=${shellroot}/sh
source_dir=${shellroot}/source
tmp_dir=${shellroot}/temp
target_dir=${shellroot}/target
js_dir=${shellroot}/js
##################³ ......

linux man ·Ç³£Ïêϸ

ʹÓÃLinuxÏÂmanÒѾ­ºÜ¾ÃÁË¡£µ«Ö»ÊÇ´ó¸ÅÖªµÀÆäÄÚÈݵĴæ·ÅĿ¼£¬ÒÔ¼°man number xxxÖÐmumberµÄº¬Òå¡£½ñÌìÐèÒªÌí¼ÓC++ man page¡£Ë³±ã½«manµÄÄÚÈÝ×÷Ò»¸ö½ÏÏêϸµÄÁ˽⡣ 0. manºóÃæÊý×ֵĺ¬Ò壺 ֮ǰSamÔÚ²éÕÒC¿âº¯Êýʱ£¬»áʹÓÃ#man 3 func ÔÚ²éÕÒϵͳµ÷ÓÃʱ£¬ÔòʹÓÃ#man 2 fork. ·ñÔòÓÐʱ»á³öÏֲ鵽ͬÃûµÄshellÖÐÃüÁîµÄÇé¿ ......

ÒÆÖ²½»»»Ð¾Æ¬SDKµ½Linuxϵͳ






ÐèÇó
£º
°Ñ88E6131½»»»Ð¾Æ¬µÄ
sdkÒÆÖ²µ½ÏÖÓÐǶÈëʽ
linuxϵͳÖУ¬Ê¹µÃÒÔºóÄÜͨ¹ýÉϲ㺯ÊýÔÚ¶Ô½»»»Ð¾Æ¬½øÐÐÅäÖòÙ×÷£¨Èç
lanÅäÖã©¡£
 




ÒÑÖªÌõ¼þ£º
*Óн»»»Ð¾Æ¬µÄÎĵµ
,sdkÔ´Âë
,Àý×Ó
,ÎÞÕë¶ÔÏÖÓÐϵͳµÄÖ±½Ó½â¾ö·½°¸
.
 








ʵÏÖ·½·¨¸ÅÊö£º
* ±àÒë ......

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

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

Linux¼°FreeBSDϵͳϲ鿴CPUÐÅÏ¢µÄ·½·¨

Ò»¡¢Linux
²é¿´cpuÐÅÏ¢£º
[junjie2@ljj ~]$ cat /proc/cpuinfo
¶þ¡¢Freebsd
dmesg ×î¼òµ¥µÄ·½·¨
freebsd# cat /var/run/dmesg.boot |grep CPU ¿ÉÒԲ鿴 cpuÐÅÏ¢
sysctl hw.model ¿´cpuid
sysctl machdep.tsc_freq ¿´cpuƵÂÊ
# sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
# dmesg | grep -i cpu ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ