why and how isn't mkdir working

5,385

All system folders are owned by root; thus,you need root permissions:

sudo mkdir -p /usr/local/java
Share:
5,385

Related videos on Youtube

tbone
Author by

tbone

Updated on September 18, 2022

Comments

  • tbone
    tbone almost 2 years

    how does mkdir work? I've been trying to install java, and when I type:

    mkdir -p /usr/local/java
    

    nothing happens except the terminal just writes it down. when I get to later steps, it says that directory /usr/local/java doesn't exist

    • Matt O.
      Matt O. over 6 years
      Are you using sudo if you're non-root user? /usr/local is owned by root, therefore mkdir won't work without the proper privileges.
    • Sergiy Kolodyazhnyy
      Sergiy Kolodyazhnyy over 6 years
      Are these exact steps youre doing ? No error ? mkdir should produce "Permission denied" error because /usr beling to root, yet you said "nothing happens". Can you clarify, please
  • Matt O.
    Matt O. over 6 years
    Paying attention to this users score, it's advisable to explain why he needs root permissions to prevent repeat questions in the future.
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy over 6 years
    sudo is indeed necessary, however note that OP said nothing happens if they do the command as regular user. However, mkdir should produce "Permission denied" error. There's discrepancy
  • cyclingLinguist
    cyclingLinguist over 3 years
    I too have the same problem even using sudo.