-bash: cd: Desktop: No such file or directory

I'm trying to type:

cd Desktop

from the /root directory, but when I do it comes up with the error:

-bash: cd: Desktop: No such file or directory

What am I doing wrong?

8

3 Answers

The /root directory is the home directory of the root user. This user doesn't have a Desktop by default since root isn't supposed to log in graphically, so you are getting that error simply because you are trying to cd into a directory that doesn't exist.

If you want to cd into your desktop, try:

cd ~/Desktop

Although, if you are in /root, you are probably logged in as root, so that won't work either.

3

If you are running it from /root then you are running it with root privilages. That means you are not an ordinary user and your default directory ~ will be /root. You are probably logged in as root. So you should log in with another user or you can just go (supposing your default is /root and from /root) cd /home/{your_username}/Desktop/.

0

try this (user account):

cd $(xdg-user-dir DESKTOP)

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