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

I tried to remove a folder in linux, davidanderson'spetshop_617 as a folder name. It contained a single quotes. By using the following command

     rm -r path/davidanderson'spetshop_617

I am getting this error

Error: unexpected EOF while looking for matching `'' unexpected end of file

How can i remove the folder?

share|improve this question

migrated from Apr 8 '11 at 15:26

This question came from our site for professional and enthusiast programmers.

Let this be a lesson to you. – Lightness Races in Orbit Apr 8 '11 at 13:27

you should issue

rm -r path/davidanderson\'spetshop_617
share|improve this answer

Wrap double quotes around the path:

rm -r "path/davidanderson'spetshop_617"

or escape the single quote in the path:

rm -r path/davidanderson\'spetshop_617
share|improve this answer

You must log in to answer this question.