4

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.

2 Answers 2

4

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.

0
3

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.

1
  • 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, 2017 at 17:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .