mv 批量
mv 批量
Table of Contents
1 mv 批量
偶尔会用到,记录一下。
ls *.txt |awk -F"-" '{print "mv "$0" "$2""}'
mv a-b.txt b.txt
mv a-c.txt c.txt
mv a-d.txt d.txt
ls *.txt |awk -F"-" '{print "mv "$0" "$2""}'|sh
ll
总用量 4
-rw-r--r-- 1 root root 0 7月 8 14:41 4.gif
-rw-r--r-- 1 root root 0 7月 9 11:19 4.jpg
-rw-r--r-- 1 root root 0 7月 14 17:54 b.txt
-rw-r--r-- 1 root root 0 7月 14 17:54 c.txt
-rw-r--r-- 1 root root 0 7月 14 17:54 d.txt
-rw-r--r-- 1 root root 33 7月 14 17:45 txta.
for a in *.txt;do mv "$a" "${a#a-}";done
posted on 2013-04-27 14:59 liweilijie 阅读(298) 评论(0) 收藏 举报
浙公网安备 33010602011771号