User Tools

Site Tools


Remove files or directories with strange names

You sometime encounter files/directories with none printable characters in the name. In order to remove such files/directories use the inode reference.

First find the inode of the file/directory

ls -il

Output (example):

73302 drwx——. 2 root root 4096 May 14 14:10 05??

Remove the directory and all content:

find . -inum 73302 -exec rm -rfi {} \;

You can leave the i (interactive) if you don't want any questions

remove_files_directories_with_strange_names.txt · Last modified: 2011/06/01 12:58 (external edit)