13¡¢grep –f ºó¸úÎļþÃû£¬Èç:
Cat 1.txt | grep –f 2.txt 2.txtÄÚÈÝÖеÄÿһÐж¼»áÔÚ1.txt½øÐÐÆ¥ÅäÏ£¬Èç¹û1.txtÎļþÖÐÓÐÆ¥ÅäµÄ£¬Ôò1.txtÎļþ½«ÏÔʾƥÅäÄÚÈÝ£¬Èç¹û2.txtºÍ1.txtµÄÎļþ¶¼ºÜ´ó£¬ÊǺÜÏûºÄÐÔÄܵÄ
14¡¢¸ü¸ÄÓû§µÄuidºÍ×éµÄgid
usermod –u uid Óû§Ãû
groupmod –g gid ×éÃû
15¡¢sed Ó÷¨
1¡¢sed½«ºÅÂëÇ°µÄ86Ìæ»»³É¿Õ
sed -i 's/^86//g' 1.txt
2¡¢½«Îı¾ÖеĵÚ115ÐÐÉÏÃæ²åÈëxxxxx
sed -i "115i\xxxxx" 1.txt
3¡¢ÔÚ¿ªÍ·¼ÓÉÏ”,ͬʱ½«¿Õ¸ñÌæ»»³É\+¿Õ¸ñ
sed -i -e "s/^/\"/g" -e "s/$/\"/g" -e "s/ /\\\ /g" mdsp_filepath.txt
4¡¢·Ö²½Ð´£¬ÔòΪ£º
sed -i "s/^/\"/g" 1.txt
sed -i "s/ /\\\ /g" 1.txt
5¡¢ÔÚÎļþÄÚÈݵÄĩβ¼ÓÉÏ”
sed -i "s/$/\"/g" 1.txt
16¡¢xargsÓ÷¨
1¡¢ÅúÁ¿ÖØÃüÃûÎļþ
ls | xargs -i mv {} {}.bak
2¡¢ÔÚÎļþÖУ¬²éѯ¹Ø¼ü×ÖµÄÐÅÏ¢
find . -name '*.CDR'|xargs grep '¹Ø¼ü×Ö'
17¡¢awkÓ÷¨
awk –FÖ¸¶¨·Ö¸ô·û£¬Ä¬Èϵķָô·ûΪ¿Õ¸ñ£¬Èç
ÒÔ|×÷Ϊ·Ö¸ô·û,È¡µÚ¾ÅÁÐ
awk -F '|' '{print $9}' 1.txt
18¡¢ÅúÁ¿È¡ÎļþËùÔڵľø¶Ô·¾¶dirname£¬ÎļþÃûÐë²»´ø¿Õ¸ñ
station90.example.com~ # cat 1.txt
/etc/ATAEV100R002C03SPC200/sles10sp2_x64.properties
/etc/ATAEV100R002C03SPC200/1206/task.properties
/etc/DIR_COLORS
station90.example.com:~ # for i in $(cat 1.txt);do dirname $i;done
/etc/ATAEV100R002C03SPC200
/etc/ATAEV100R002C03SPC200/1206
/etc
19¡¢ÅúÁ¿È¡ÎļþÃûbasename
station90.example.com~# for i in $(cat 1.txt);do basename $i;done
sles10sp2_x64.properties
task.properties
DIR_COLORS
netcontrol_global_hooks
20¡¢rsync´«ÊäÎļþ
rsync –avH –n –delete ./ oracle@192.168.15.28:/home/oracle/
-n ²¢²»»áÕæÕýµÄ´«Ê䣬ֻÊÇÒ»ÖÖ²âÊÔ
-aʾÒԵݹ鷽ʽ´«ÊäÎļþ£¬²¢±£³ÖËùÓÐÎļþÊôÐÔ
--delete Èç¹ûÔ¶³ÌÎļþºÍ±»´«ÊäµÄĿ¼Îļþ²»Í¬£¬Ôòɾ³ý£¨½÷É÷ʹÓã©
ºóÐø¼ÌÐø¸üУ¬ÏÖÔÚÄÔ´ü¾ÍÏÈÏëµ½ÁËÕâЩ£¬ÅóÓÑÃǾõµÃºÃµÄ£¬¾ÍÁôÑÔ¸øÎÒ£¬ÎÒÒ»²¢Õû³öÀ´£¬Ò»Æð½ø²½£¡£¡£¡