今天又遇到个新问题,如果想批量的砍掉后缀名呢?
具体命令如下:
find -name "*.txt" |for i in *;do mv $i `echo $i |sed ‘s/.txt//g’`;done
find -name "*.txt" |awk -F’.’ ‘{print $1} |xargs mv {}.txt {}
如果只是修改后缀名,用rename 即可,命令如下:
rename .txt .bk *
今天又遇到个新问题,如果想批量的砍掉后缀名呢?
具体命令如下:
find -name "*.txt" |for i in *;do mv $i `echo $i |sed ‘s/.txt//g’`;done
find -name "*.txt" |awk -F’.’ ‘{print $1} |xargs mv {}.txt {}
如果只是修改后缀名,用rename 即可,命令如下:
rename .txt .bk *