How to cd into a directory with space in the name?

前端 未结 14 2348
独厮守ぢ
独厮守ぢ 2020-11-27 05:30

I\'m attempting to get into the directory /cygdrive/c/Users/my dir/Documents:

$ DOCS=\"/cygdrive/c/Users/my\\ dir/Documents\"

$ echo $DOCS
/cyg         


        
14条回答
  •  一向
    一向 (楼主)
    2020-11-27 06:02

    SOLUTION:

    cd "Documents and Photos"
    

    problem solved.

    The reason I'm submitting this answer is you'll find that StackOverflow is being used by every day users (not just web devs, programmers or power users) and this was the number one result for a simple Windows user question on Google.

    People are becoming more tech-savvy, but aren't necessarily familiar with command line in the cases above.

提交回复
热议问题