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

前端 未结 14 2389
独厮守ぢ
独厮守ぢ 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:09

    ok i spent some frustrating time with this problem too. My little guide.

    Open desktop for example. If you didnt switch your disc in cmd, type:

    cd desktop

    Now if you want to display subfolders:

    cd, make 1 spacebar, and press tab 2 times

    Now if you want to enter directory/file with SPACE IN NAME. Lets open some file name f.g., to open it we need to type:

    cd file\ name

    p.s. notice this space after slash :)

提交回复
热议问题