0
7

More than 5 years have passed since last update.

Linuxでファイル名が壊れた時の修復方法メモ

Last updated at Posted at 2017-02-28

文字コードが変わってしまったり、特殊文字がファイル名に含まれちゃっててまともにアクセスできなくなったときの対処法。inumオプションよく忘れるのでメモ。

ls -il
で、先頭にinode番号が表示されます。

find -inum inode番号
で、ファイル名取得ができます。

``(バッククオート)で囲めばコマンドの結果を使うことができるので、
mv "`find -inum inode番号`" 変更するファイル名
または
mv $(find -inum inode番号) 変更するファイル名  (こっちのほうがいいかな?)
とすれば、どんなファイル名でも変更できます。

0
7
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
7