|
mv 批量
Table of Contents
1 mv 批量
偶尔会用到,记录一下。
ls *.txt |awk -F"-" '{print "mv "$0" "$2""}'mv a-b.txt b.txtmv a-c.txt c.txtmv a-d.txt d.txtls *.txt |awk -F"-" '{print "mv "$0" "$2""}'|shll总用量 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
Date: 2013-04-27 Sat
version 7.9.2 with version 23