Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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


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?

share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007, Daniel Andersson, Synetech, Andrew Lambert, Carl B Dec 20 '13 at 14:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Quote the quotes.

rm "'filename'"
share|improve this answer

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

rm \'filename\'

enter image description here

share|improve this answer