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

30,473

Solution 1

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.

Solution 2

try this (user account):

cd $(xdg-user-dir DESKTOP)

Solution 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/.

Share:
30,473

Related videos on Youtube

Malicious
Author by

Malicious

Updated on September 18, 2022

Comments

  • Malicious
    Malicious over 1 year

    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?

    • terdon
      terdon almost 5 years
      Where are you running this command from? What is the output of pwd? And what is the output of ls -ld Desktop?
    • Malicious
      Malicious almost 5 years
      I'm running it from /root
    • FedKad
      FedKad almost 5 years
      Normally root user's home directory is /root, but it will not contain a Desktop directory because root user is not and should not be used to login into desktop.
    • Malicious
      Malicious almost 5 years
      What should I do then?
    • terdon
      terdon almost 5 years
      @Malicious depends. What do you actually want to do? Why do you want to cd into /root/Desktop?
    • Malicious
      Malicious almost 5 years
      I'm trying to get the files I installed to end up in my Desktop.
    • terdon
      terdon almost 5 years
      @Malicious you don't want to install things on your Desktop, they wouldn't work. It's probably best if you ask a new question, starting from the beginning. Explain what you have done (what and how did you install), and what you are trying to do. If you just want an icon on your Desktop that you can click on to launch something, that can be done, but we need to know the while situation.
    • Malicious
      Malicious almost 5 years
      I'm trying to get this thing from git called cupp into my desktop so I can access the wordlists.
  • Malicious
    Malicious almost 5 years
    That doesn't work either.
  • terdon
    terdon almost 5 years
    @Malicious yes, of course it doesn't work. As I explained in the answer, there is no /root/Desktop directory. And, as I also mentioned, if you are in /root, then you are probably logged in as the root user so ~/Desktop will also not work because that will be expanded to /root/Desktop. You cannot cd into a directory that doesn't exist.
  • Malicious
    Malicious almost 5 years
    I tried the commands and it said when I typed cd /root/Desktop/ it said -bash: cd: /root/Desktop/: Permission denied what do I do?