infoMore than 1 year has passed since last update.
ShiftJISファイル名が交じるガラケー時代のディレクトリ内のファイルの名前をUTF-8に一括変換
Last updated at Posted at 2022-03-26
環境
- Amazon Linux
- ガラケー時代にFTPでアップロードされた名前がShiftJISでエンコードされたファイルが多数
- Amazon Linux では、
sudo yum install convmv
は No packages
となる
手順
-
CentOS6 convmv
で RPMパッケージを検索
- RPMをダウンロード
- RPMからインストール
sudo yum install -y <ダウンロードしたRPM>.rpm
cd <ファイルを一括変換するルートディレクトリー>
- 変換のテスト
convmv -r -f cp932 -t utf-8 * ~/convmv.log
- 文字コードの想定があっているかチェック
less ~convmv.log
- 変換
convmv --notest -r -f cp932 -t utf-8 * ~/convmv.log
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up