ºìÁªLinuxÃÅ»§
Linux°ïÖú

linuxÏÂÅúÁ¿¸ÄÃû

·¢²¼Ê±¼ä:2008-03-04 20:57:21À´Ô´:ºìÁª×÷Õß:bliunxrf
ÓÐÈËÌáÎÊ£¬ÓÐÈË´ð!

linuxÏ£¬ÅúÁ¿¸ÄÃû

for files in `ls *.`
do
mv $files `echo "$filests" `
done
ÉÏÃæµÄ×Ô¼º¿ÉÒÔÏë³öÀ´£¬ÏÂÃæµÄÄØ?»¹Ã»Óп¼Ö¤¹ý

1. find ./ -name xxx -exec mv {} {}.xx \
Õâ¸öÊÇ×î¼òµ¥µÄÁË,µ«ÊÇÓÐÒ»µã²»ºÃµÄÊÇÖ»ÄÜÔÚºóÃæ¼Ó¸öºó׺
2.find ./ -name xxx | xargs -I mv {} {}.xx
Ò»ÑùµÄµÀÀí
3.find ./ -name XXX | awk ''{printf("mv %s \t %s \n",$1,$1)}'' |sh
awk ÀïÃæ¿ÉÒÔ×ÔÓÉ·¢»Ó µ¥´¿µÄ¶ÔÎļþÃû´¦ÀíÀ´Ëµ »¹²»ÊÇawkµÄÇ¿Ïî
4.ÄǾÍÀ´sed°É
find ./ -name xxx | sed ''s/XXX/mv xxx xxxxx/'' |sh
ЧÂÊ ×¢ÒâЧÂÊ!
´´½¨½ø³ÌµÄÏûºÄÊǺܴóµÄ,ËùÒÔÄÜÓÃxargsµÄʱºò¾Í²»ÒªÓà |sh
ls -1|sed ''s/.old$//''|xargs -I {} mv {}.old {}
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ