How to chmod files that have a specific set of permissionschmod: permissions of a directory don't...

Are small insurances worth it

Commonest[] function doesn't actually show commonest elements

Create chunks from an array

The (Easy) Road to Code

How to chmod files that have a specific set of permissions

Regex Too Complicated - replaceAll - large strings preprocessed before deserialize

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

Estimating the efficiency of a shortened (loaded) antenna

Why would the IRS ask for birth certificates or even audit a small tax return?

Are mobile cities justifiable in sci-fi settings?

What is the meaning of option 'by' in TikZ Intersections

Is being socially reclusive okay for a graduate student?

Deal the cards to the players

Why is there an extra space when I type "ls" on the Desktop?

Sundering Titan and basic normal lands and snow lands

Is there a math equivalent to the conditional ternary operator?

Can a Tiny Servant be used as a messenger?

How do you write a macro that takes arguments containing paragraphs?

Under what conditions would I NOT add my Proficiency Bonus to a Spell Attack Roll (or Saving Throw DC)?

Can a Mimic (container form) actually hold loot?

What is the purpose of a disclaimer like "this is not legal advice"?

Can a space-faring robot still function over a billion years?

PTIJ: Mordechai mourning

How to close up the table border in a multi-row situation?



How to chmod files that have a specific set of permissions


chmod: permissions of a directory don't changeHaving trouble with chmodSite creation script - missing chmod permissionsBest practices for permissions in major directories in UbuntuPermission denied for 'sudo' after 'sudo chmod 666 /usr'Setting permissions for /var/www/mysite?chmod hard drive at grub?I set permission with chmod, but files created later don't have the same permissionsFix permissions of server after accidental chmodchmod does not seem to be changing permissions of a sd card













4















I want to find all files in a folder that have -rw-r----- (640? is that the right code?) permissions, and change them all to have -rw-rw-rw- instead. How do I do this, with chmod?



I know I could do the whole folder with



sudo chmod -R 666 /path/to/folder


but I think (perhaps mistakenly?) that it would be more efficient to just do the ones that actually need it?



Alternatively, rather than specifically looking for -rw-r-----, I could chmod any file that doesn't have 666 already? Would that be better?










share|improve this question

























  • You definitely do not want to do chmod -R 666, since it would remove the executable bit from the folder, making it unbrowseable. chmod -R a=rwX maybe.

    – fkraiem
    8 hours ago






  • 1





    Yes that just occurred to me - I think chmod -R +r,+w might be best. There shouldn't be any executable stuff in that folder anyway.

    – Max Williams
    8 hours ago











  • If there's nothing executable, including no subfolders, no need for -R, just do chmod 666 /path/*.

    – fkraiem
    8 hours ago











  • Just to be clear, yes rw-r----- == 640

    – wjandrea
    28 mins ago
















4















I want to find all files in a folder that have -rw-r----- (640? is that the right code?) permissions, and change them all to have -rw-rw-rw- instead. How do I do this, with chmod?



I know I could do the whole folder with



sudo chmod -R 666 /path/to/folder


but I think (perhaps mistakenly?) that it would be more efficient to just do the ones that actually need it?



Alternatively, rather than specifically looking for -rw-r-----, I could chmod any file that doesn't have 666 already? Would that be better?










share|improve this question

























  • You definitely do not want to do chmod -R 666, since it would remove the executable bit from the folder, making it unbrowseable. chmod -R a=rwX maybe.

    – fkraiem
    8 hours ago






  • 1





    Yes that just occurred to me - I think chmod -R +r,+w might be best. There shouldn't be any executable stuff in that folder anyway.

    – Max Williams
    8 hours ago











  • If there's nothing executable, including no subfolders, no need for -R, just do chmod 666 /path/*.

    – fkraiem
    8 hours ago











  • Just to be clear, yes rw-r----- == 640

    – wjandrea
    28 mins ago














4












4








4








I want to find all files in a folder that have -rw-r----- (640? is that the right code?) permissions, and change them all to have -rw-rw-rw- instead. How do I do this, with chmod?



I know I could do the whole folder with



sudo chmod -R 666 /path/to/folder


but I think (perhaps mistakenly?) that it would be more efficient to just do the ones that actually need it?



Alternatively, rather than specifically looking for -rw-r-----, I could chmod any file that doesn't have 666 already? Would that be better?










share|improve this question
















I want to find all files in a folder that have -rw-r----- (640? is that the right code?) permissions, and change them all to have -rw-rw-rw- instead. How do I do this, with chmod?



I know I could do the whole folder with



sudo chmod -R 666 /path/to/folder


but I think (perhaps mistakenly?) that it would be more efficient to just do the ones that actually need it?



Alternatively, rather than specifically looking for -rw-r-----, I could chmod any file that doesn't have 666 already? Would that be better?







chmod






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 hours ago









Braiam

52.3k20137222




52.3k20137222










asked 8 hours ago









Max WilliamsMax Williams

807




807













  • You definitely do not want to do chmod -R 666, since it would remove the executable bit from the folder, making it unbrowseable. chmod -R a=rwX maybe.

    – fkraiem
    8 hours ago






  • 1





    Yes that just occurred to me - I think chmod -R +r,+w might be best. There shouldn't be any executable stuff in that folder anyway.

    – Max Williams
    8 hours ago











  • If there's nothing executable, including no subfolders, no need for -R, just do chmod 666 /path/*.

    – fkraiem
    8 hours ago











  • Just to be clear, yes rw-r----- == 640

    – wjandrea
    28 mins ago



















  • You definitely do not want to do chmod -R 666, since it would remove the executable bit from the folder, making it unbrowseable. chmod -R a=rwX maybe.

    – fkraiem
    8 hours ago






  • 1





    Yes that just occurred to me - I think chmod -R +r,+w might be best. There shouldn't be any executable stuff in that folder anyway.

    – Max Williams
    8 hours ago











  • If there's nothing executable, including no subfolders, no need for -R, just do chmod 666 /path/*.

    – fkraiem
    8 hours ago











  • Just to be clear, yes rw-r----- == 640

    – wjandrea
    28 mins ago

















You definitely do not want to do chmod -R 666, since it would remove the executable bit from the folder, making it unbrowseable. chmod -R a=rwX maybe.

– fkraiem
8 hours ago





You definitely do not want to do chmod -R 666, since it would remove the executable bit from the folder, making it unbrowseable. chmod -R a=rwX maybe.

– fkraiem
8 hours ago




1




1





Yes that just occurred to me - I think chmod -R +r,+w might be best. There shouldn't be any executable stuff in that folder anyway.

– Max Williams
8 hours ago





Yes that just occurred to me - I think chmod -R +r,+w might be best. There shouldn't be any executable stuff in that folder anyway.

– Max Williams
8 hours ago













If there's nothing executable, including no subfolders, no need for -R, just do chmod 666 /path/*.

– fkraiem
8 hours ago





If there's nothing executable, including no subfolders, no need for -R, just do chmod 666 /path/*.

– fkraiem
8 hours ago













Just to be clear, yes rw-r----- == 640

– wjandrea
28 mins ago





Just to be clear, yes rw-r----- == 640

– wjandrea
28 mins ago










1 Answer
1






active

oldest

votes


















12














find /path/to/folder -perm 640 -exec chmod 666 {} ;





share|improve this answer





















  • 5





    To find only files (not oddly-specified directories) with permissions 640, add -type f eg: find -type f /path/to/folder -perm 640 -exec chmod 666 {} ;

    – Pelle
    6 hours ago








  • 3





    And don't forget about using + instead of ; with -exec so it only runs chmod once, instead of separately for each file.

    – Barmar
    2 hours ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1123746%2fhow-to-chmod-files-that-have-a-specific-set-of-permissions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









12














find /path/to/folder -perm 640 -exec chmod 666 {} ;





share|improve this answer





















  • 5





    To find only files (not oddly-specified directories) with permissions 640, add -type f eg: find -type f /path/to/folder -perm 640 -exec chmod 666 {} ;

    – Pelle
    6 hours ago








  • 3





    And don't forget about using + instead of ; with -exec so it only runs chmod once, instead of separately for each file.

    – Barmar
    2 hours ago
















12














find /path/to/folder -perm 640 -exec chmod 666 {} ;





share|improve this answer





















  • 5





    To find only files (not oddly-specified directories) with permissions 640, add -type f eg: find -type f /path/to/folder -perm 640 -exec chmod 666 {} ;

    – Pelle
    6 hours ago








  • 3





    And don't forget about using + instead of ; with -exec so it only runs chmod once, instead of separately for each file.

    – Barmar
    2 hours ago














12












12








12







find /path/to/folder -perm 640 -exec chmod 666 {} ;





share|improve this answer















find /path/to/folder -perm 640 -exec chmod 666 {} ;






share|improve this answer














share|improve this answer



share|improve this answer








edited 8 hours ago

























answered 8 hours ago









mucluxmuclux

2,6511828




2,6511828








  • 5





    To find only files (not oddly-specified directories) with permissions 640, add -type f eg: find -type f /path/to/folder -perm 640 -exec chmod 666 {} ;

    – Pelle
    6 hours ago








  • 3





    And don't forget about using + instead of ; with -exec so it only runs chmod once, instead of separately for each file.

    – Barmar
    2 hours ago














  • 5





    To find only files (not oddly-specified directories) with permissions 640, add -type f eg: find -type f /path/to/folder -perm 640 -exec chmod 666 {} ;

    – Pelle
    6 hours ago








  • 3





    And don't forget about using + instead of ; with -exec so it only runs chmod once, instead of separately for each file.

    – Barmar
    2 hours ago








5




5





To find only files (not oddly-specified directories) with permissions 640, add -type f eg: find -type f /path/to/folder -perm 640 -exec chmod 666 {} ;

– Pelle
6 hours ago







To find only files (not oddly-specified directories) with permissions 640, add -type f eg: find -type f /path/to/folder -perm 640 -exec chmod 666 {} ;

– Pelle
6 hours ago






3




3





And don't forget about using + instead of ; with -exec so it only runs chmod once, instead of separately for each file.

– Barmar
2 hours ago





And don't forget about using + instead of ; with -exec so it only runs chmod once, instead of separately for each file.

– Barmar
2 hours ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1123746%2fhow-to-chmod-files-that-have-a-specific-set-of-permissions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

Castillo d'Acher Características Menú de navegación

Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...