Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com 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

2 Answers 2

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.