When I try to change my working directory to C:\Users\Michell Payano\Desktop\Data Analytics Tools, the result is -bash: cd: too many arguments
. I want to know what is wrong.
Asked
Active
Viewed 3,003 times
0

muru
- 197,895
- 55
- 485
- 740
-
1It's not clear what command you are using the change the directory. It would help if you provided the specific line of code. However, there may be at least two issues - (1) Linux doesn't use drive designators like C: (check the mount point for this disk partition), and (2) folder names that contain spaces must be enclosed in quotes. – CentaurusA Sep 04 '18 at 00:49
-
3Possible duplicate of How to navigate to C drive in bash on WSL-Ubuntu? – muru Sep 27 '18 at 05:28
-
And https://askubuntu.com/questions/398400/how-do-i-navigate-to-folders-with-spaces-in-their-names-i-get-no-such-file-or – muru Sep 27 '18 at 05:28
1 Answers
5
The problem is the spaces between Michell and Payano, between Data and Analytics, and between Analytics and Tools.
Use this:
cd "C:\Users\Michell Payano\Desktop\Data Analytics Tools"
or this:
cd C:\\Users\\Michell\ Payano\\Desktop\\Data\ Analytics\ Tools
In the first form, the whole path is put in double quotes to avoid the string from being broken up. In the second form, spaces are "escaped" by preceding them with a backslash, meaning that they are part of the path. The backslashes already in the path need to be escaped as well to be recognized as path separators.

Jos
- 29,224
-
@steeldriver Yes, thanks, I missed the first space. Will edit. Didn't elaborate about escaping the backslashes because I'm not sure how WSL (where this comes from, presumably) handles these. – Jos Sep 04 '18 at 00:57