2

I unintentionally saved a file with vim with an apostrophe and now when I attempt to use my cli to remove it doesn't allow me to do it because Linux can't recognize it.

eg

$ rm '
> 
Zanna
  • 70,465
hmota
  • 121

1 Answers1

7

It should be sufficient to double-quote it:

$ touch "'"
$ ls -l "'"
-rw-rw-r-- 1 steeldriver steeldriver 0 May 20 09:27 '
$ rm -i "'"
rm: remove regular empty file ''\'''? y

You could also use a backslash escape rm \'

steeldriver
  • 136,215
  • 21
  • 243
  • 336