Another_username@lemmy.world to Linux@lemmy.ml · edit-28 months agoneed help restoring permissions on my downloads folderlemmy.worldimagemessage-square37fedilinkarrow-up11arrow-down10file-text
arrow-up11arrow-down1imageneed help restoring permissions on my downloads folderlemmy.worldAnother_username@lemmy.world to Linux@lemmy.ml · edit-28 months agomessage-square37fedilinkfile-text
I removed my permissions on my downloads folder using chmod. can anyone help restore back to default? Thanks!
minus-squaret҉̠̙ǵ̣̞̄ͪ͜x̸̱͚̳ͫ͐̑̈ͯͣ̚n̒͌҉͉̦̜̝ͅ@lemmy.tgxn.netlinkfedilinkarrow-up0·8 months ago-R to recurse. Good for chmod and chown
minus-squareEager Eagle@lemmy.worldlinkfedilinkEnglisharrow-up0·8 months agouseful 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 -- {} +
minus-squarecaseyweederman@lemmy.calinkfedilinkarrow-up0·8 months agoGo over it with a second chmod -R but with -X to add execute but only to directories
minus-squaretoynbee@lemmy.worldlinkfedilinkarrow-up0·8 months agoIf 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.
minus-squarePossibly linux@lemmy.ziplinkfedilinkEnglisharrow-up0·edit-28 months agoDon’t give all your files execution permissions. chmod 644 -R Downloads chmod +x Downloads
minus-squaret҉̠̙ǵ̣̞̄ͪ͜x̸̱͚̳ͫ͐̑̈ͯͣ̚n̒͌҉͉̦̜̝ͅ@lemmy.tgxn.netlinkfedilinkarrow-up0·edit-28 months agoThat’s the same as 755, except you are only setting execute on the folder?
-R to recurse. Good for chmod and chown
useful for
chown
, less so forchmod
: 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 -- {} +
Go over it with a second chmod -R but with -X to add execute but only to directories
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 ofugo
for user, group or other.Don’t give all your files execution permissions.
chmod 644 -R Downloads chmod +x Downloads
That’s the same as 755, except you are only setting execute on the folder?