One of the main folders in my computer is named as "OneDrive - University of XXX". I have been trying to access it from the command line with low success. I think the problem is on the "-" in the middle.

I use the command -ls to show the files and I can see that "OneDrive - University of XXX" is there. If I type "OneD" and then use tab/autocompletion, I can see both folders, but the response to "OneDrive - University of XXX" is -bash: cd: /OneDrive: No such file or directory.


The problem are rather the spaces. Assuming your quotes in the questions are just for formatting and you do not actually put the argument for cd in quotes.

cd OneDrive\ -\ University of XXX or if this does not work, put it in quotes: cd "OneDrive - University of XXX". Both work for me in a git bash on Windows 10 which should also be working for you then I guess.

| improve this answer | |

Another neat trick is to use the tab function when accessing folder or file names. Just type cd One then hit tab twice and the required back slashes will be added automatically. Always great and helpful to remember this.

| improve this answer | |
  • 1
    That’s what I did to discover the solution with the backslashes. I didn’t know about \ , I would have just used quotes. – bugybunny Nov 2 '17 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.