3

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
  • 100,812
Malicious
  • 31
  • 1
  • 1
  • 2
  • 2
    Where are you running this command from? What is the output of pwd? And what is the output of ls -ld Desktop? – terdon May 25 '19 at 12:53
  • I'm running it from /root – Malicious May 25 '19 at 13:13
  • 2
    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. – FedKad May 25 '19 at 13:16
  • What should I do then? – Malicious May 25 '19 at 13:18
  • 3
    @Malicious depends. What do you actually want to do? Why do you want to cd into /root/Desktop? – terdon May 25 '19 at 15:20
  • I'm trying to get the files I installed to end up in my Desktop. – Malicious May 26 '19 at 01:12
  • @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. – terdon May 26 '19 at 09:21
  • I'm trying to get this thing from git called cupp into my desktop so I can access the wordlists. – Malicious May 26 '19 at 09:41

3 Answers3

4

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.

terdon
  • 100,812
  • That doesn't work either. – Malicious May 25 '19 at 14:38
  • 2
    @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. – terdon May 25 '19 at 15:20
  • 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? – Malicious May 26 '19 at 00:59
2

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

Ugur Akgul
  • 64
  • 4
1

try this (user account):

cd $(xdg-user-dir DESKTOP)
acgbox
  • 2,200