Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have to open a directory from terminal but the directory name contains a single quote, how Can I open it? Here is the name of the directory

02. Setting Up 'Shop
share|improve this question
You forgot to tell us what OS you're using. – Daniel Beck Mar 19 '12 at 5:44
remotely accessing CentOS from Mac terminal – coure2011 Mar 19 '12 at 5:54
up vote 5 down vote accepted

Either escape spaces and the quote with \, or wrap the whole directory name in double quotes.

share|improve this answer

suround the directory name with quotes

$ cd "02. Setting Up 'Shop"

or mask the 'special' characters

$ cd 02.\ Settings\ Up\ \'Shop
share|improve this answer
-bash: 33m]ommand not found -bash: 31m: command not found – coure2011 Mar 19 '12 at 6:57
a dot doesn't have to be escaped. – daniel kullmann Mar 19 '12 at 8:16
@coure2011: what exactly did you enter to get that error message back? Quoted string or using escape sequences ('\')? And you don't enter the '$' in the beginning. These commands are used to color the terminal output ([0;33m -> yellow, 0;31m -> red). You can try to set a minimalistic prompt, eg. export PS1='\h:\W \u\$'. Or to check your prompt: echo "$PS1" – boretom Mar 19 '12 at 9:43
@danielkullmann: Of course you're right, sill me :) – boretom Mar 19 '12 at 10:05

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.