0

I have a file called ^?x (thats ^? the backspace character). I have no idea how it got that way, but I need to get rid of it. Except when I try to do rm I don't really know what to type. How can I delete the file?

David says Reinstate Monica
  • 19,209
  • 22
  • 79
  • 122

1 Answers1

3

Do you have other files that end in x? If not, just rm *x will do it. If you do need to type it directly, you can use \010 which is the octal sequence for the backspace character.

Carl Norum
  • 219,201
  • 40
  • 422
  • 469
  • 1
    In this case, I'd recommend `rm -i *x`, or since it's one character `rm -r ?x` – glenn jackman Jul 25 '14 at 18:33
  • `^?` is the DEL character, not backspace. Backspace is represented as `^H`. But octal sequences aren't automatically translated in shell commands; if I type `rm \010` my shell just ignores the backslash. In bash you can use `rm $'\010'` -- or, in this case, `rm $'\177x` – Keith Thompson Jul 25 '14 at 19:10
  • Oops, typo, I meant `-i` (interactive) – glenn jackman Jul 25 '14 at 19:19