Linux重命名之转换编码

有时候解压缩或者复制文件时,遇到一些文件的文件名并非UTF-8编码,可以利用iconv,在终端里面批量转换编码。如下是从GBK转换成UTF-8:

for f in *; do a="$(echo $f|iconv -f gbk)"; mv "$f" "$a"; done;

linux, ubuntu, bulk, batch, rename, mv, iconv, gbk, utf8, filename, encoding, convert

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google+ photo

You are commenting using your Google+ account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

w

Connecting to %s