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 have a problem with cd-ing into folder named "--Recovery Files" and can't remember how to escape dashes in the filename. Any ideas?

share|improve this question

migrated from stackoverflow.com Jul 11 '11 at 14:52

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

You can use:

cd -- '--Recovery Files'

The -- tells cd that no further command line arguments should be treated as options.

share|improve this answer
2  
+1, never knew that existed! – adarshr Jul 11 '11 at 14:51

2 choices:

  1. cd -- --Recovery\ Files
  2. cd ./--Recovery\ Files
share|improve this answer
cd -- '--Recovery Files'

The -- by itself indicates that subsequent words beginning with a dash are not to be interpreted as command-line options.

share|improve this answer

You must log in to answer this question.