0

Is there a command where you can access root from the linux terminal? (/cd ~root) I have had to change my minecraft saves files under root, and had to run the command:

cd ~/Downloads
sudo java -jar Minecraft-Installer.jar

Running the jar file under "sudo" works, but it doesn't without it, for some reason. Could someone help me please?

N0rbert
  • 99,918
Earl
  • 1

1 Answers1

3

Okay, a few things to note here:

  • Why are your saves under root? Don't run Minecraft with sudo, and then it should be stored in your home directory.
  • ~ is a shorthand for your home directory. The command cd ~/root does not make any sense.
  • Your command should be formatted differently. Try running cd ~/Downloads and then java -jar Minecraft-Installer.jar.
  • If you want to access the root user, run su.
Pilot6
  • 90,100
  • 91
  • 213
  • 324
NotNite
  • 31
  • 1
    The command /cd ~root does not make any sense. - no, ~user means home of the given user. What doesn't make sense here is /cd - it should be just cd ~root. – Arkadiusz Drabczyk Mar 14 '20 at 20:35
  • ^^ yup, ~/root would mean a directory called root inside the invoking user's $HOME whereas ~root (without the /) means the home directory of the user with login name root, which makes sense and is /root by default (although its permissions likely prevent any user aside from root from cding to it). – steeldriver Mar 14 '20 at 21:32