accessing Desktop from Root directory

14,210

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

Share:
14,210

Related videos on Youtube

dexter
Author by

dexter

Updated on September 18, 2022

Comments

  • dexter
    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
    dexter about 8 years
    I am using "sudo -i" to become the root and still not working.
  • SomeoneSomewhereSupportsMonica
    SomeoneSomewhereSupportsMonica about 8 years
    sudo -i still sets you as root, and your home directory is still /root.
  • dexter
    dexter about 8 years
    but I am unable to write data on my Desktop from root directory.
  • SomeoneSomewhereSupportsMonica
    SomeoneSomewhereSupportsMonica about 8 years
    @dexter, what error do you get? Or where does it write to, if it succeeds?
  • dexter
    dexter about 8 years
    My 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
    SomeoneSomewhereSupportsMonica about 8 years
    @dexter then you still aren't using the correct command. Use the command at the start of the third paragraph.