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?

link|improve this question
feedback

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

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

3 Answers

You can use:

cd -- '--Recovery Files'

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

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

2 choices:

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

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown