How to remove files with strange characters

To remove files that contain symbols and unknown characters, list the files with ls -li and take note of the inode number

root@linux:~ # ls -li
total 4420
2495260 -rw——- 1 root root 13810 Jan 28 2011 ????!
2495249 -rw——- 1 root root 13810 Jan 28 2011 ????!

Run the find command and see if it shows the desired file

root@linux:~ # find . -inum 2495260
./????!

And then complete the find command to search, find and remove the file.

root@linux:~ # find . -inum 2495260 -exec rm -i {} \;
rm: remove regular file `./20\36406\b!’? y

Advertisement