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 a directory called "Reader 0.5" in my Desktop on Mac Os X. When to access the directory in terminal, I am using below code:

cd /Users/niho/Desktop/Reader 0.5

but it throws:

No such file or directory


How can I cd into that directory?


share|improve this question

migrated from Mar 13 '11 at 12:17

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

Either you put quotes around the directory name (cd "/Users/niho/Desktop/Reader 0.5") or you escape the directory name (/Users/niho/Desktop/Reader\ 0.5).

share|improve this answer
Just for the sake of completeness, you can also decide to quote just parts of the argument, like cd /Users/niho/Desktop/"Reader 0.5" or even cd /Users/niho/Desktop/Reader" "0.5 – user123444555621 Mar 13 '11 at 12:14
The last one (infix quotes) was new to me. Thank you! – joschi Mar 13 '11 at 17:07
Now: how do you place the path with the infix spaces into an env var so you can do % cd $foo ? – Bogatyr Oct 8 '15 at 22:42

You can escape the space:

cd /Users/niho/Desktop/Reader\ 0.5
share|improve this answer

As others have mentioned, quoting the path or backslash-escaping the spaces will work.

In addition bash, the default shell on Mac OS X, supports command-line completion using the Tab key. So e.g. if you type:

cd /Users/niho/Desktop/Re

then press the Tab key, the shell will fill in the rest of the folder name (as long as there are no other folders on your Desktop starting with "Re"), and will take care of quoting the arguments to cd if there are spaces in the directory name it fills in.

share|improve this answer

Fyi, using the Tab in bash shortcut would break at the first space it encounters if multiple directories have identical first names. In such cases a user would have to use:

cd Adobe\ Creative\ Cloud/

or what I prefer,

cd 'Adobe Creative Cloud'
share|improve this answer
On both bash and zsh, the quoting does not work for me : ``` bash 2 => cd '~/Library/' bash: cd: ~/Library/: No such file or directory 3 => cd ~/Library/ 4 => pwd /Users/pguruprasad/Library ``` – Prasanth May 31 at 22:08

Your Answer


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