6

There's a lot of stuff about this on the Internet, but most of the examples there are contrived. How does one delete files that are really stubborn? e.g.,

$ find ./ -inum 167794
./àKÈÿÿÿÿ@
$ find ./ -inum 167794 -exec rm \"{}\" \;
rm: cannot lstat `"./\037\340\025K\021\004\310\377\377\377\377@\020\002"': Invalid or incomplete multibyte or wide character
mgjk
  • 914

3 Answers3

8

Try removing the escaped double quotes. I believe rm thinks those are part of the filename.

find ./ -inum 167794 -exec rm {} \;
6

Better way with modern find (version 4.2.3 or later):

find ./ -inum 167794 -delete
womble
  • 98,245
METAJIJI
  • 161
  • 1
  • 3
0

If you want safe quoting for every shell I know, use this:

find ./ -inum 167794 -exec rm '{}' ';'