accessing Desktop from Root directory
~
is a shortcut to your home directory. So you'd type cd ~
to get to your home directory, or cd ~/Desktop
to get to your desktop.
However, if you've used sudo su
to become root, this won't work - it'll take you to root's home directory.
cd /home/<your username>/Desktop
will always take you to your desktop folder if you have access permissions. I'm not sure if there's a faster way while logged in as root.
Related videos on Youtube
dexter
Updated on September 18, 2022Comments
-
dexter over 1 year
I was using aircrack-ng package in my ubuntu 15.04. This package works only under root privileges. Now I want to save .cap file on my desktop using airodump-ng package but everytime I do, it throws an error
-bash: cd: Desktop/: No such file or directory
Please let me know how can I access Desktop from my root directory. I am using "sudo -i" to become the root.
-
dexter about 8 yearsI am using "sudo -i" to become the root and still not working.
-
SomeoneSomewhereSupportsMonica about 8 years
sudo -i
still sets you as root, and your home directory is still/root
. -
dexter about 8 yearsbut I am unable to write data on my Desktop from root directory.
-
SomeoneSomewhereSupportsMonica about 8 years@dexter, what error do you get? Or where does it write to, if it succeeds?
-
dexter about 8 yearsMy error is same as the mentioned in the question and I intend to write on the Desktop which is the normal Desktop of our computer.
-
SomeoneSomewhereSupportsMonica about 8 years@dexter then you still aren't using the correct command. Use the command at the start of the third paragraph.