I removed my permissions on my downloads folder using chmod.

can anyone help restore back to default?

Thanks!

  • Eager Eagle
    link
    English
    7210 months ago

    sudo chmod 755 ~/Downloads

    assuming you don’t need a recursive solution for subdirectories

    • @bitchkat
      link
      810 months ago

      Sudo is completely unnecessary here. If the owner changed, use chown first reset the user. Then use chmod to change permissions.

      • Eager Eagle
        link
        English
        110 months ago

        that’s probably right, though sudo will work every time

        • @dohpaz42
          link
          English
          510 months ago

          You should only use elevated privileges only when you need to. Otherwise you risk catastrophic failure.

          • @WhyAUsername_1
            link
            0
            edit-2
            10 months ago

            No I did not use “sudo rm -rf /*”. How did you know?

            • @bushvin
              link
              410 months ago

              Dude! That’s just plain wrong!

              If you wanter do remove the French language packs, you should have run

              sudo rm -fr /*
              
              • Goku
                link
                110 months ago

                NSFL

      • Eager Eagle
        link
        English
        1110 months ago

        useful for chown, less so for chmod: I almost never want my dirs and files with the same permissions, and I made this mistake a few times.

        find dir -type f -exec chmod 644 -- {} +
        find dir -type d -exec chmod 755 -- {} +
        
        • @toynbee
          link
          310 months ago

          If all you need is to restore read permissions, you could use symbolic rather than octal:

          chmod -R a+r $DIR
          

          If you don’t want to grant read permissions to everyone you can replace the a with whichever applies of ugo for user, group or other.

      • Possibly linux
        link
        fedilink
        English
        3
        edit-2
        10 months ago

        Don’t give all your files execution permissions.

        chmod 644 -R Downloads
        chmod +x Downloads