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?
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?
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.
/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
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/.
pwd? And what is the output ofls -ld Desktop? – terdon May 25 '19 at 12:53/root, but it will not contain aDesktopdirectory because root user is not and should not be used to login into desktop. – FedKad May 25 '19 at 13:16cdinto/root/Desktop? – terdon May 25 '19 at 15:20