On Linux, when you extract compressed files created on Windows, (especially with application developed by Japanese speakers) Japanese characters in file name are garbled. You can’t rename or delete them via file browser (like dolphin or nautilus) in usual way, so you have to rename it via command line.
First, move on to the directory which garbled file is included. In my case, files are included under /home/phanect/
$ > cd /home/phanect
Then, execute “ls” command with “-i”option.
$ > ls -i
294930 ???J?p?@archive?? 294913 bin 286741 Download
319490 Documents 286820 Templates 303105 public_html
303106 Desktop
You can see numbers before the file name. This is named inode number. You can specify the file instead of the file name with it. This time, we want to delete “???J?p?@archive??” so we use “294930“
Next, use find command.
$ > find /home/phanect -inum 294930
./???J?p?@archive??
With this command, you can get file name specified by inode number.
The first argument “/home/phanect” is the directory including garbled file.
And specify inode number with “-inum” option. 294930 is the inode number of garbled file in this case.
Can you see the file name which you want to rename?
Now, let’s rename it.
You can execute desired command to the file with find command.
$ > find /home/phanect -inum 294930 -exec [command] \;
You can write command between “-exec” and “\;”
(“\;” means the end of the command. More details for Wikipedia.)
Well, in this case, you want to execute following command:
$ > mv ???J?p?@archive?? new_file_name.txt
Of course this doesn’t work because file name is garbled.
So instead you have to execute:
$ > find /home/phanect -inum 294930 -exec mv {} new_file_name.txt \;
{} means the file name. (“???J?p?@archive??”) In this case, file is not specified with file name but inode number, so renaming is safely done.