linux comm ÃüÁî½éÉÜ
Èç¹ûÏëÔÚLinuxÃüÁîÐз½Ê½Ï£¬¶Ô2¸öÎı¾ÎļþµÄÄÚÈÝ×ö±È½Ï£¬ÕÒ³öͬʱ°üº¬ÔÚÕâ2¸öÎı¾ÎļþÖеÄÄÚÈÝ£¬¿ÉÒÔʹÓÃLinuxϵͳ´øµÄ¹¤¾ßcommÀ´´¦Àí£¬Ç°ÌáÊDZ»±È½ÏµÄ2¸öÎı¾ÎļþÒªÊÇÓÐÐòµÄ£¬¿ÉÒÔÏÈÓÃsort´¦Àíһϣ¬¾ßÌå²Ù×÷·½·¨ÈçÏ£º
ÔʼÎļþÈçÏ£º
a.txt
d
c
b
a
b.txt
g
f
b
a
ÅÅÐò´¦Àí
sort a.txt > a1.txt
sort b.txt > b1.txt
´¦Àí½á¹ûÎļþÈçÏ£º
a1.txt
a
b
c
d
b1.txt
a
b
f
g
±È½Ï´¦Àí
comm a1.txt b1.txt
a
b
f
g
c
d
Êä³ö½á¹û°üÀ¨3ÁÐ ÆäÖеÚ3ÁÐÏÔʾµÄÊÇ2¸öÎļþÖж¼°üº¬µÄÄÚÈÝ¡£
µÚ1ÁÐÏÔʾֻ°üº¬ÔÚµÚÒ»¸öÎļþa.txtÖеÄ
µÚ2ÁÐÏÔʾֻ°üº¬ÔÚµÚ¶þ¸öÎļþb.txtÖеÄ
¿ÉÒÔͨ¹ý²ÎÊýÖ¸¶¨ÒªÏÔʾµÄÁÐ È磺
comm a1.txt b1.txt -12
a
b
-12 ±íʾ²»ÏÔʾµÚ1Áк͵Ú2ÁУ¬Ö»ÏÔʾµÚ3ÁÐ
-1 ²»ÏÔʾµÚ1ÁУ¬ÏÔʾµÚ2£¬3 ÁÐ
-13 ²»ÏÔʾµÚ1£¬3ÁУ¬ÏÔʾµÚ2ÁÐ
Ïà¹ØÎĵµ£º
ps -aux|grep java ²é¿´java½ø³Ì
tar xvfz tomcat5.tar.gz ½âѹÎļþ
mount -o username=administrator,password=zyj //192.168.1.1/info /info Ó³ÉäÍøÂçÇý¶¯Æ÷
rm -rf ./info ³¹µ×ɾ³ýÎļþ¼Ð¼°ÆäÀïÃæµÄÄÚÈÝ
tail -f catalina.out ²é¿´ÈÕÖ¾Îļþ ......
Èç¹ûÏëÈÃËùÓÐÓû§share:
emacs -nw /etc/profile
È»ºóÔÚδβ¼ÓÈë
#set java environment
set JAVA_HOME=/usr/java/jdk1.5.0_16
set PATH=.:$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
Èç¹û½öµ±Ç°Óû§Ê¹Óãº
°ÑÉÏÃæµÄ¼ÓÈëÓû§Ä¿Â¼ÏµÄ.bash_profile»ò.bash-rc
È»ºóÔËÐÐsource /etc/profileÉúЧ ......
route add -net 10.10.101.0 netmask 255.255.255.0 gw 10.10.100.1
cat route-eth0
10.10.101.0/24 via 10.10.100.1 dev eth0
/etc/rc.d/init.d/network restart
netstat -r
[root@1314it network-scripts]# cat /etc/sysconfig/network-scripts/route-eth0
123.123.123.0 via 156.156.156.156 de ......
1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......
Ê×ÏÈÉêÃ÷,ÎÒÊDzËÄñ.²Ëµ½Ê²Ã´³Ì¶È,´ó¼Ò¿´¿´ÏÂÃæµÄ´úÂë.
´úÂëÒªÇó:È¡µÃ1000´Îµ¥¶À´´½¨½ø³ÌµÄʱ¼ä.
[code:1:fdac913669]#include
#include
#include
#include
#include
strut timeval {
long tv_sec; /* ÃëÊý */
long tv_usec; /* ΢ÃëÊý  ......