linux ³£ÓÃÃüÁîÕûÀí
tar ÎļþÓëĿ¼ѹËõÃüÁî
tar [-cxtzjvfpPN] ÎļþÓëĿ¼ ....
²ÎÊý£º
-c £º½¨Á¢Ò»¸öѹËõÎļþµÄ²ÎÊýÖ¸Áî(create µÄÒâ˼)£»
-x £º½â¿ªÒ»¸öѹËõÎļþµÄ²ÎÊýÖ¸Á
-t £º²é¿´ tarfile ÀïÃæµÄÎļþ£¡
Ìرð×¢Ò⣬ÔÚ²ÎÊýµÄÏ´ïÖУ¬ c/x/t ½öÄÜ´æÔÚÒ»¸ö£¡²»¿Éͬʱ´æÔÚ£¡ÒòΪ²»¿ÉÄÜͬʱѹËõÓë½âѹËõ¡£
-z £ºÊÇ·ñͬʱ¾ßÓÐ gzip µÄÊôÐÔ£¿Ò༴ÊÇ·ñÐèÒªÓà gzip ѹËõ£¿
-j £ºÊÇ·ñͬʱ¾ßÓÐ bzip2 µÄÊôÐÔ£¿Ò༴ÊÇ·ñÐèÒªÓà bzip2 ѹËõ£¿
-v £ºÑ¹ËõµÄ¹ý³ÌÖÐÏÔʾÎļþ£¡Õâ¸ö³£Ó㬵«²»½¨ÒéÓÃÔÚ±³¾°Ö´Ðйý³Ì£¡
-f £ºÊ¹ÓõµÃû£¬ÇëÁôÒ⣬ÔÚ f Ö®ºóÒªÁ¢¼´½ÓµµÃûร¡²»ÒªÔÙ¼Ó²ÎÊý£¡ÀýÈçʹÓẠtar -zcvfP tfile sfile¡»¾ÍÊÇ´íÎóµÄд·¨£¬ÒªÐ´³É¡º tar -zcvPf tfile sfile¡»²Å¶Ôร¡
-p £ºÊ¹ÓÃÔÎļþµÄÔÀ´ÊôÐÔ£¨ÊôÐÔ²»»áÒÀ¾ÝʹÓÃÕ߶ø±ä£©
-P £º¿ÉÒÔʹÓþø¶Ô·¾¶À´Ñ¹Ëõ£¡
-N £º±ÈºóÃæ½ÓµÄÈÕÆÚ(yyyy/mm/dd)»¹ÒªÐµIJŻᱻ´ò°ü½øн¨µÄÎļþÖУ¡
--exclude FILE£ºÔÚѹËõµÄ¹ý³ÌÖУ¬²»Òª½« FILE ´ò°ü£¡
·¶Àý£º
·¶ÀýÒ»£º½«Õû¸ö /etc Ŀ¼ÏµÄÎļþÈ«²¿´ò°ü³ÉΪ /tmp/etc.tar
[root@linux ~]# tar -cvf /tmp/etc.tar /etc<==½ö´ò°ü£¬²»Ñ¹Ëõ£¡
[root@linux ~]# tar -zcvf /tmp/etc.tar.gz /etc <==´ò°üºó£¬ÒÔ gzip ѹËõ
[root@linux ~]# tar -jcvf /tmp/etc.tar.bz2 /etc <==´ò°üºó£¬ÒÔ bzip2 ѹËõ
# Ìرð×¢Ò⣬ÔÚ²ÎÊý f Ö®ºóµÄÎļþµµÃûÊÇ×Ô¼ºÈ¡µÄ£¬ÎÒÃÇÏ°¹ßÉ϶¼Óà .tar À´×÷Ϊ±æʶ¡£
# Èç¹û¼Ó z ²ÎÊý£¬ÔòÒÔ .tar.gz »ò .tgz À´´ú±í gzip ѹËõ¹ýµÄ tar file ¡«
# Èç¹û¼Ó j ²ÎÊý£¬ÔòÒÔ .tar.bz2 À´×÷Ϊ¸½µµÃû°¡¡«
# ÉÏÊöÖ¸ÁîÔÚÖ´ÐеÄʱºò£¬»áÏÔʾһ¸ö¾¯¸æѶϢ£º
# ¡ºtar: Removing leading `/" from member names¡»ÄÇÊǹØ춾ø¶Ô·¾¶µÄÌØÊâÉ趨¡£
·¶Àý¶þ£º²éÔÄÉÏÊö /tmp/etc.tar.gz ÎļþÄÚÓÐÄÄЩÎļþ£¿
[root@linux ~]# tar -ztvf /tmp/etc.tar.gz
# ÓÉì¶ÎÒÃÇʹÓà gzip ѹËõ£¬ËùÒÔÒª²éÔĸà tar file ÄÚµÄÎļþʱ£¬
# ¾ÍµÃÒª¼ÓÉÏ z Õâ¸ö²ÎÊýÁË£¡ÕâºÜÖØÒªµÄ£¡
·¶ÀýÈý£º½« /tmp/etc.tar.gz Îļþ½âѹËõÔÚ /usr/local/src µ×ÏÂ
[root@linux ~]# cd /usr/local/src
[root@linux src]# tar -zxvf /tmp/etc.tar.gz
# ÔÚÔ¤ÉèµÄÇé¿öÏ£¬ÎÒÃÇ¿ÉÒÔ½«Ñ¹ËõµµÔÚÈκεط½½â¿ªµÄ£¡ÒÔÕâ¸ö·¶ÀýÀ´Ëµ£¬
# ÎÒÏȽ«¹¤×÷Ŀ¼±ä»»µ½ /usr/local/src µ×Ï£¬²¢Çҽ⿪ /tmp/etc.tar.gz £¬
# Ôò½â¿ªµÄĿ¼»áÔÚ /usr/local/src/etc ÄØ£¡ÁíÍ⣬Èç¹ûÄú½øÈë /usr/local/src/etc
# Ôò»á·
Ïà¹ØÎĵµ£º
²é¿´µ±Ç°ÅäÖÃ×Ö·û¼¯ locale
²é¿´È«²¿×Ö·û¼¯ locale -a
ÉèÖÃ×Ö·û¼¯ export LANG=zh_CN.gbk
easy
tcpdump Ò»¸ölinux¼àÌýÍøÂç·ÃÎʵŤ¾ß
¼àÌý·þÎñÆ÷¼°¶Ë¿Ú
tcpdump -nn -i eth0 src host www.codigg.com and src port 80
ÕýÔÚʹÓõÄsql
tcpdump -s 0 -l -w - dst port 3306 | strings ......
3. ÍøÂçÅäÖÃÎļþ
3.1 /etc/hosts
#/etc/hosts
#Îļþ¸ñʽ: IPaddress hostname aliases
#Îļþ¹¦ÄÜ: ÌṩÖ÷»úÃûµ½IPµØÖ·µÄ¶ÔÓ¦¹Øϵ£¬½¨Ò齫×Ô¼º¾³£Ê¹ÓõÄÖ÷»ú
# ¼ÓÈë´ËÎļþÖУ¬Ò²¿É½«Ã»ÓÐDNS¼Ç¼µÄ»úÆ÷¼ÓÈëµ½´ËÎļþÖУ¬
# ÕâÑù»á·½±ãÍøÂçÓ¦ÓÃ
127.0.0.1 localhost localhost.localdomain
202.118.66.81 helius.dlut. ......
±êÌ⣺Linux½ø³ÌͨÐÅ-ʹÓÃÐźÅÁ¿
Ò»¡¢Ïà¹Ø֪ʶ
ÐźÅÁ¿£ºÒ»¸öÕûÊý£»
´óÓÚ»òµÈÓÚ0ʱ´ú±í¿É¹©²¢·¢½ø³ÌʹÓõÄ×ÊԴʵÌåÊý£»
СÓÚ0ʱ´ú±íÕýÔڵȴýʹÓÃÁÙ½çÇøµÄ½ø³ÌÊý£»
ÓÃÓÚ»¥³âµÄÐźÅÁ¿³õʼֵӦ´óÓÚ0£»
Ö»ÄÜͨ¹ýP¡¢VÔÓï²Ù×÷¶ø¸Ä±ä£»
ÐźÅÁ¿ÔªËØ×é³É£º
1¡¢±íʾÐźÅÁ¿ÔªË ......
ÔÚlinuxÄں˵ÄÔ´´úÂëÖУ¬ÒÔ»ã±àÓïÑÔ±àдµÄ³ÌÐò»ò³ÌÐò¶Î£¬ÓÐÁ½ÖÖ²»Í¬µÄÐÎʽ¡£
µÚÒ»ÖÖÊÂÍêÈ«µÄ»ã±à´úÂ룬ÕâÑùµÄ´úÂë²ÉÓÃ.s×÷ΪÎļþµÄºó׺¡£ÊÂʵÉÏ£¬¾¡¹ÜÊÇÍêÈ«µÄ»ã±à´úÂ룬ÏÖ´úµÄ»ã±à¹¤¾ßÒ²ÎüÊÕÁËCÓïÑԵij¤´¦£¬Ò²ÔÚ»ã±à֮ǰ¼ÓÉÏÁËÒ»ÌËÔ¤´¦Àí£¬¶øÔ¤´¦Àí֮ǰµÄÎļþÔòÒÔ.sΪºó׺¡£´ËÀࣨ.s£©ÎļþÒ²ºÍC³ÌÐòÒ»Ñù£¬¿ÉÒÔʹÓÃ#includ ......