Why cant i change directory on desktop in terminal?

When i want to change the directory to a specific folder on my desktop (summer 2020 classes) it tells me that no such user or named directory exists.

I want to open 'summer 2020 classes' from desktop

Example from terminal:

cd desktop
cd summer 2020 classes 

and i get this error:

string not in pwd: summer
or
too many arguments 

1 Answer

You are getting the error because the cd command thinks you are giving it three different directories (summer, 2020 and classes) when it expects a single one.

For files and directories containing spaces you need to either enclose in quotes or escape the spaces:

cd "summer 2020 classes" # using quotes

or

cd summer\ 2020\ classes # escaping the spaces

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like