6

I have a file which I wrote and not thinking put the actual filename in single quotes like this:

'filename'

When I try to remove it using rm -f 'filename' it does not recognize that it is there I get the error:

rm: cannot remove 'filename'. No such file or directory.

Any suggestions?

Giacomo1968
  • 58,727

2 Answers2

10

Quote the quotes.

rm "'filename'"
3

Another option (in addition to @IgnacioVasquezAbrams's answer) is to escape the '

rm \'filename\'

enter image description here

Giacomo1968
  • 58,727
nerdwaller
  • 18,014