Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd, 2017 please sign up again. Thanks!

sudo mkdir sets root permission

Discussion in 'Command Line' started by TCRatius, Nov 3, 2017.

  1. TCRatius

    TCRatius Member

    Joined:
    Aug 30, 2017
    Messages:
    21
    Likes Received:
    25
    Hey Everyone,

    I'm using the newest release of Linux Mint Cinnamon and when I mkdir from terminal for some reason the directory folder and all subs permissions are; owner and group set to root. This is a pain the arse cause I don't know how to do recursive chmod. I have a basic understanding that it's chmod -R. The stuff that follows just confuses me. Example chmod u=rwx,g=rx,o=r myfile. Thing is I want to set the permissions to the directory. Any help would be appreciated. :rolleyes:

    Seems some of the files I create afterwards are not able to be trashed.


    (Log in to hide this advertisement)


    $ ls -ld ~/.local/share/Trash/
    output
    $ drwx------ 4 root root 4096 Nov 3 17:37

    Answer was
    $ sudo chmod -R 700 ~/.local/share/Trash. I don't really get this and not really sure if I should do this as 7 is god mode.
     
    #1 TCRatius, Nov 3, 2017
    Last edited: Nov 3, 2017
  2. atanere

    atanere Moderator
    Gold Supporter

    Joined:
    Apr 6, 2017
    Messages:
    1,707
    Likes Received:
    1,807
    I'm using Mint Mate, and I'm not getting the same response... or I'm misunderstanding you.

    mkdir <dirname> makes the user the owner.
    sudo mkdir <dirname> makes root the owner, as it should. (Your title suggests sudo mkdir)

    Cheers
     
    Dyablo503 and Thsnos023 like this.
  3. TCRatius

    TCRatius Member

    Joined:
    Aug 30, 2017
    Messages:
    21
    Likes Received:
    25
    gotta love simple solutions. So use to sudoing everything. Looks like your answer fixed it. Cheers tc
     
    #3 TCRatius, Nov 3, 2017
    Last edited: Nov 9, 2017
    Thsnos023, Rob and wizardfromoz like this.
  4. atanere

    atanere Moderator
    Gold Supporter

    Joined:
    Apr 6, 2017
    Messages:
    1,707
    Likes Received:
    1,807
    Simple is better for me too. (It has to be, or I'm out of options! :D) Glad all is working properly for you.
     
    Thsnos023, TCRatius and wizardfromoz like this.

Share This Page