如何批量修改文件名,*.DAT >> *.mpg
如题 用rename.具体参看 info rename. 用rename.
具体参看 info rename. mv *.DAT*.mpg for i in `ls *.DAT|cut -d. -f1`
do mv $i.DAT $i.mpg
done 都不行啊!! 我这个好像没问题啊,自己实践过的,注意 `ls *.DAT|cut -d. -f1`两边是反引号,不是单引号,就是tab键上面那个。
用rename也行,更简单,rename .DAT .mpg *.DAT就行了。 rename
NAME
rename - Rename files
SYNOPSIS
rename from to file...
DESCRIPTION
renamewillrenamethe specified files by replacing the first occur-
rence of from in their name by to.
For example, given the files foo1, ..., foo9, foo10, ...,foo278,the
commands
rename foo foo0 foo?
rename foo foo0 foo??
will turn them into foo001, ..., foo009, foo010, ..., foo278.
And
rename .htm .html *.htm
will fix the extension of your html files.
页:
[1]