Find all files on server with 777 permissions












47















I'm looking for a Linux command to go through all the directories on my server and find all files with 777 permission. The output would be a list of all those files with full path.










share|improve this question















migrated from stackoverflow.com Nov 16 '09 at 3:19


This question came from our site for professional and enthusiast programmers.























    47















    I'm looking for a Linux command to go through all the directories on my server and find all files with 777 permission. The output would be a list of all those files with full path.










    share|improve this question















    migrated from stackoverflow.com Nov 16 '09 at 3:19


    This question came from our site for professional and enthusiast programmers.





















      47












      47








      47


      12






      I'm looking for a Linux command to go through all the directories on my server and find all files with 777 permission. The output would be a list of all those files with full path.










      share|improve this question
















      I'm looking for a Linux command to go through all the directories on my server and find all files with 777 permission. The output would be a list of all those files with full path.







      linux command-line permissions find chmod






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 13 '10 at 7:19









      quack quixote

      35.3k1087119




      35.3k1087119










      asked Nov 15 '09 at 22:53







      bartclaeys











      migrated from stackoverflow.com Nov 16 '09 at 3:19


      This question came from our site for professional and enthusiast programmers.









      migrated from stackoverflow.com Nov 16 '09 at 3:19


      This question came from our site for professional and enthusiast programmers.
























          4 Answers
          4






          active

          oldest

          votes


















          59














          Use find:



          find / -type f -perm 0777





          share|improve this answer

































            16














            And if you like to find all files without Permission 0777 then just enter a ! before the perm, e.g.



            find / -type f ! -perm 0777






            share|improve this answer































              9














              You can also change the permissions or ownership of all those files resulting from the find execution using the -exec option to avoid change them manually.
              Exempli gratia: In a web server you could need to grant the group to write files:



              find / -type f -perm 0777 -exec chmod 775 {} ; -exec chgrp -R www {} ;





              share|improve this answer





















              • 1





                Be very very careful doing this - always worth using -exec ls first in order to see what the effect of your command will do. Find is super powerful and will often find things you didn't expect it to.

                – John Hunt
                Mar 24 '17 at 11:24











              • It's true. My command should be used once you know which files will result from the search.

                – altmas5
                Apr 5 '17 at 17:25



















              8














              it's as easy as:



              find / -perm 0777


              if you only want to match files, use this instead:



              find / -type f -perm 0777





              share|improve this answer























                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "3"
                };
                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%2fsuperuser.com%2fquestions%2f71041%2ffind-all-files-on-server-with-777-permissions%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown
























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                59














                Use find:



                find / -type f -perm 0777





                share|improve this answer






























                  59














                  Use find:



                  find / -type f -perm 0777





                  share|improve this answer




























                    59












                    59








                    59







                    Use find:



                    find / -type f -perm 0777





                    share|improve this answer















                    Use find:



                    find / -type f -perm 0777






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 28 at 13:24









                    Twisty Impersonator

                    18.4k146699




                    18.4k146699










                    answered Nov 15 '09 at 22:57









                    jheddingsjheddings

                    72155




                    72155

























                        16














                        And if you like to find all files without Permission 0777 then just enter a ! before the perm, e.g.



                        find / -type f ! -perm 0777






                        share|improve this answer




























                          16














                          And if you like to find all files without Permission 0777 then just enter a ! before the perm, e.g.



                          find / -type f ! -perm 0777






                          share|improve this answer


























                            16












                            16








                            16







                            And if you like to find all files without Permission 0777 then just enter a ! before the perm, e.g.



                            find / -type f ! -perm 0777






                            share|improve this answer













                            And if you like to find all files without Permission 0777 then just enter a ! before the perm, e.g.



                            find / -type f ! -perm 0777







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 16 '11 at 9:53









                            KaiKai

                            16112




                            16112























                                9














                                You can also change the permissions or ownership of all those files resulting from the find execution using the -exec option to avoid change them manually.
                                Exempli gratia: In a web server you could need to grant the group to write files:



                                find / -type f -perm 0777 -exec chmod 775 {} ; -exec chgrp -R www {} ;





                                share|improve this answer





















                                • 1





                                  Be very very careful doing this - always worth using -exec ls first in order to see what the effect of your command will do. Find is super powerful and will often find things you didn't expect it to.

                                  – John Hunt
                                  Mar 24 '17 at 11:24











                                • It's true. My command should be used once you know which files will result from the search.

                                  – altmas5
                                  Apr 5 '17 at 17:25
















                                9














                                You can also change the permissions or ownership of all those files resulting from the find execution using the -exec option to avoid change them manually.
                                Exempli gratia: In a web server you could need to grant the group to write files:



                                find / -type f -perm 0777 -exec chmod 775 {} ; -exec chgrp -R www {} ;





                                share|improve this answer





















                                • 1





                                  Be very very careful doing this - always worth using -exec ls first in order to see what the effect of your command will do. Find is super powerful and will often find things you didn't expect it to.

                                  – John Hunt
                                  Mar 24 '17 at 11:24











                                • It's true. My command should be used once you know which files will result from the search.

                                  – altmas5
                                  Apr 5 '17 at 17:25














                                9












                                9








                                9







                                You can also change the permissions or ownership of all those files resulting from the find execution using the -exec option to avoid change them manually.
                                Exempli gratia: In a web server you could need to grant the group to write files:



                                find / -type f -perm 0777 -exec chmod 775 {} ; -exec chgrp -R www {} ;





                                share|improve this answer















                                You can also change the permissions or ownership of all those files resulting from the find execution using the -exec option to avoid change them manually.
                                Exempli gratia: In a web server you could need to grant the group to write files:



                                find / -type f -perm 0777 -exec chmod 775 {} ; -exec chgrp -R www {} ;






                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited May 20 '12 at 21:32

























                                answered May 19 '12 at 17:01









                                altmas5altmas5

                                19026




                                19026








                                • 1





                                  Be very very careful doing this - always worth using -exec ls first in order to see what the effect of your command will do. Find is super powerful and will often find things you didn't expect it to.

                                  – John Hunt
                                  Mar 24 '17 at 11:24











                                • It's true. My command should be used once you know which files will result from the search.

                                  – altmas5
                                  Apr 5 '17 at 17:25














                                • 1





                                  Be very very careful doing this - always worth using -exec ls first in order to see what the effect of your command will do. Find is super powerful and will often find things you didn't expect it to.

                                  – John Hunt
                                  Mar 24 '17 at 11:24











                                • It's true. My command should be used once you know which files will result from the search.

                                  – altmas5
                                  Apr 5 '17 at 17:25








                                1




                                1





                                Be very very careful doing this - always worth using -exec ls first in order to see what the effect of your command will do. Find is super powerful and will often find things you didn't expect it to.

                                – John Hunt
                                Mar 24 '17 at 11:24





                                Be very very careful doing this - always worth using -exec ls first in order to see what the effect of your command will do. Find is super powerful and will often find things you didn't expect it to.

                                – John Hunt
                                Mar 24 '17 at 11:24













                                It's true. My command should be used once you know which files will result from the search.

                                – altmas5
                                Apr 5 '17 at 17:25





                                It's true. My command should be used once you know which files will result from the search.

                                – altmas5
                                Apr 5 '17 at 17:25











                                8














                                it's as easy as:



                                find / -perm 0777


                                if you only want to match files, use this instead:



                                find / -type f -perm 0777





                                share|improve this answer




























                                  8














                                  it's as easy as:



                                  find / -perm 0777


                                  if you only want to match files, use this instead:



                                  find / -type f -perm 0777





                                  share|improve this answer


























                                    8












                                    8








                                    8







                                    it's as easy as:



                                    find / -perm 0777


                                    if you only want to match files, use this instead:



                                    find / -type f -perm 0777





                                    share|improve this answer













                                    it's as easy as:



                                    find / -perm 0777


                                    if you only want to match files, use this instead:



                                    find / -type f -perm 0777






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 15 '09 at 22:56









                                    knittlknittl

                                    2,97811216




                                    2,97811216






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Super User!


                                        • 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%2fsuperuser.com%2fquestions%2f71041%2ffind-all-files-on-server-with-777-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

                                        Mouse cursor on multiple screens with different PPI

                                        Agildo Ribeiro

                                        Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”