Use chmod recursively to increase permissions for files and directories below a threshold but do not change those that are already above the threshold [closed]










-1















I am using Linux (RHEL 7.5) and have a directory containing some files and directories that have 750 permissions (or lower), and some files and directories that have 777 permissions.



I wish to increase the permissions (recursively) for those files and directories that are at 750 (or below) to 755, but to leave those that have permissions 777 as they are.



How can I accomplish this selective "ratcheting up" of permissions?










share|improve this question













closed as off-topic by Barmar, Tsyvarev, Rob, Andy Jones, Graham Nov 13 '18 at 0:57


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – Barmar, Tsyvarev, Rob, Andy Jones, Graham
If this question can be reworded to fit the rules in the help center, please edit the question.
















  • According to man (you did read man, right?) you can use + to add bits and - to subtract bits.

    – Gem Taylor
    Nov 12 '18 at 20:08











  • Thanks for your reply. I did read man chmod, and I think you are referring to this section: "The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed except that a directory's unmentioned set user and group ID bits are not affected." I think I'm failing to understand something fundamental about chmod--can you please explain to me how the + and - can be used to solve my problem?

    – 0012
    Nov 12 '18 at 20:15







  • 1





    You want to add the r and x permissions to others. If the permissions are already 777, it won't change anything. If the permissions are 750 it will change to 755.

    – Barmar
    Nov 12 '18 at 20:21











  • Stack Overflow is for programming questions, not questions about using or configuring Linux and its applications. Super User or Unix & Linux would be better places for questions like this.

    – Barmar
    Nov 12 '18 at 20:21






  • 1





    So it should be o+rx.

    – Barmar
    Nov 12 '18 at 20:22















-1















I am using Linux (RHEL 7.5) and have a directory containing some files and directories that have 750 permissions (or lower), and some files and directories that have 777 permissions.



I wish to increase the permissions (recursively) for those files and directories that are at 750 (or below) to 755, but to leave those that have permissions 777 as they are.



How can I accomplish this selective "ratcheting up" of permissions?










share|improve this question













closed as off-topic by Barmar, Tsyvarev, Rob, Andy Jones, Graham Nov 13 '18 at 0:57


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – Barmar, Tsyvarev, Rob, Andy Jones, Graham
If this question can be reworded to fit the rules in the help center, please edit the question.
















  • According to man (you did read man, right?) you can use + to add bits and - to subtract bits.

    – Gem Taylor
    Nov 12 '18 at 20:08











  • Thanks for your reply. I did read man chmod, and I think you are referring to this section: "The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed except that a directory's unmentioned set user and group ID bits are not affected." I think I'm failing to understand something fundamental about chmod--can you please explain to me how the + and - can be used to solve my problem?

    – 0012
    Nov 12 '18 at 20:15







  • 1





    You want to add the r and x permissions to others. If the permissions are already 777, it won't change anything. If the permissions are 750 it will change to 755.

    – Barmar
    Nov 12 '18 at 20:21











  • Stack Overflow is for programming questions, not questions about using or configuring Linux and its applications. Super User or Unix & Linux would be better places for questions like this.

    – Barmar
    Nov 12 '18 at 20:21






  • 1





    So it should be o+rx.

    – Barmar
    Nov 12 '18 at 20:22













-1












-1








-1








I am using Linux (RHEL 7.5) and have a directory containing some files and directories that have 750 permissions (or lower), and some files and directories that have 777 permissions.



I wish to increase the permissions (recursively) for those files and directories that are at 750 (or below) to 755, but to leave those that have permissions 777 as they are.



How can I accomplish this selective "ratcheting up" of permissions?










share|improve this question














I am using Linux (RHEL 7.5) and have a directory containing some files and directories that have 750 permissions (or lower), and some files and directories that have 777 permissions.



I wish to increase the permissions (recursively) for those files and directories that are at 750 (or below) to 755, but to leave those that have permissions 777 as they are.



How can I accomplish this selective "ratcheting up" of permissions?







linux bash unix permissions chmod






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 '18 at 19:51









00120012

3817




3817




closed as off-topic by Barmar, Tsyvarev, Rob, Andy Jones, Graham Nov 13 '18 at 0:57


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – Barmar, Tsyvarev, Rob, Andy Jones, Graham
If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Barmar, Tsyvarev, Rob, Andy Jones, Graham Nov 13 '18 at 0:57


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – Barmar, Tsyvarev, Rob, Andy Jones, Graham
If this question can be reworded to fit the rules in the help center, please edit the question.












  • According to man (you did read man, right?) you can use + to add bits and - to subtract bits.

    – Gem Taylor
    Nov 12 '18 at 20:08











  • Thanks for your reply. I did read man chmod, and I think you are referring to this section: "The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed except that a directory's unmentioned set user and group ID bits are not affected." I think I'm failing to understand something fundamental about chmod--can you please explain to me how the + and - can be used to solve my problem?

    – 0012
    Nov 12 '18 at 20:15







  • 1





    You want to add the r and x permissions to others. If the permissions are already 777, it won't change anything. If the permissions are 750 it will change to 755.

    – Barmar
    Nov 12 '18 at 20:21











  • Stack Overflow is for programming questions, not questions about using or configuring Linux and its applications. Super User or Unix & Linux would be better places for questions like this.

    – Barmar
    Nov 12 '18 at 20:21






  • 1





    So it should be o+rx.

    – Barmar
    Nov 12 '18 at 20:22

















  • According to man (you did read man, right?) you can use + to add bits and - to subtract bits.

    – Gem Taylor
    Nov 12 '18 at 20:08











  • Thanks for your reply. I did read man chmod, and I think you are referring to this section: "The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed except that a directory's unmentioned set user and group ID bits are not affected." I think I'm failing to understand something fundamental about chmod--can you please explain to me how the + and - can be used to solve my problem?

    – 0012
    Nov 12 '18 at 20:15







  • 1





    You want to add the r and x permissions to others. If the permissions are already 777, it won't change anything. If the permissions are 750 it will change to 755.

    – Barmar
    Nov 12 '18 at 20:21











  • Stack Overflow is for programming questions, not questions about using or configuring Linux and its applications. Super User or Unix & Linux would be better places for questions like this.

    – Barmar
    Nov 12 '18 at 20:21






  • 1





    So it should be o+rx.

    – Barmar
    Nov 12 '18 at 20:22
















According to man (you did read man, right?) you can use + to add bits and - to subtract bits.

– Gem Taylor
Nov 12 '18 at 20:08





According to man (you did read man, right?) you can use + to add bits and - to subtract bits.

– Gem Taylor
Nov 12 '18 at 20:08













Thanks for your reply. I did read man chmod, and I think you are referring to this section: "The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed except that a directory's unmentioned set user and group ID bits are not affected." I think I'm failing to understand something fundamental about chmod--can you please explain to me how the + and - can be used to solve my problem?

– 0012
Nov 12 '18 at 20:15






Thanks for your reply. I did read man chmod, and I think you are referring to this section: "The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed except that a directory's unmentioned set user and group ID bits are not affected." I think I'm failing to understand something fundamental about chmod--can you please explain to me how the + and - can be used to solve my problem?

– 0012
Nov 12 '18 at 20:15





1




1





You want to add the r and x permissions to others. If the permissions are already 777, it won't change anything. If the permissions are 750 it will change to 755.

– Barmar
Nov 12 '18 at 20:21





You want to add the r and x permissions to others. If the permissions are already 777, it won't change anything. If the permissions are 750 it will change to 755.

– Barmar
Nov 12 '18 at 20:21













Stack Overflow is for programming questions, not questions about using or configuring Linux and its applications. Super User or Unix & Linux would be better places for questions like this.

– Barmar
Nov 12 '18 at 20:21





Stack Overflow is for programming questions, not questions about using or configuring Linux and its applications. Super User or Unix & Linux would be better places for questions like this.

– Barmar
Nov 12 '18 at 20:21




1




1





So it should be o+rx.

– Barmar
Nov 12 '18 at 20:22





So it should be o+rx.

– Barmar
Nov 12 '18 at 20:22












1 Answer
1






active

oldest

votes


















1














You can add permissions using the + operator, so to make sure they are at least 755 you can do chmod -R u+rwx,go+rx /some/path - in other words, make sure the user has read, write and executable rights, and that group and other have read and execute.






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    You can add permissions using the + operator, so to make sure they are at least 755 you can do chmod -R u+rwx,go+rx /some/path - in other words, make sure the user has read, write and executable rights, and that group and other have read and execute.






    share|improve this answer



























      1














      You can add permissions using the + operator, so to make sure they are at least 755 you can do chmod -R u+rwx,go+rx /some/path - in other words, make sure the user has read, write and executable rights, and that group and other have read and execute.






      share|improve this answer

























        1












        1








        1







        You can add permissions using the + operator, so to make sure they are at least 755 you can do chmod -R u+rwx,go+rx /some/path - in other words, make sure the user has read, write and executable rights, and that group and other have read and execute.






        share|improve this answer













        You can add permissions using the + operator, so to make sure they are at least 755 you can do chmod -R u+rwx,go+rx /some/path - in other words, make sure the user has read, write and executable rights, and that group and other have read and execute.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 '18 at 20:47









        l0b0l0b0

        33.8k1585147




        33.8k1585147













            Popular posts from this blog

            Medaillenspiegel der Olympischen Winterspiele 1968

            Kleinkühnau

            Makov (Slowakei)