Find folders contains names+1900-1990+names

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to do at search for lots of folders contains ex. Events.1900-1990.events. I don't want folders ex. with Events.2004, only folders contains the years from 1900 -> 1990.



The name Event can be anything, it could be birthdays, wars, etc..



I know I should use regex, but I'm not an expert here :(



I have tried something like this:



find . -type d -regex '*/[a-z][A-Z]/19+[0-9]*' -print


But without finding anything










share|improve this question



























    up vote
    0
    down vote

    favorite












    I'm trying to do at search for lots of folders contains ex. Events.1900-1990.events. I don't want folders ex. with Events.2004, only folders contains the years from 1900 -> 1990.



    The name Event can be anything, it could be birthdays, wars, etc..



    I know I should use regex, but I'm not an expert here :(



    I have tried something like this:



    find . -type d -regex '*/[a-z][A-Z]/19+[0-9]*' -print


    But without finding anything










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to do at search for lots of folders contains ex. Events.1900-1990.events. I don't want folders ex. with Events.2004, only folders contains the years from 1900 -> 1990.



      The name Event can be anything, it could be birthdays, wars, etc..



      I know I should use regex, but I'm not an expert here :(



      I have tried something like this:



      find . -type d -regex '*/[a-z][A-Z]/19+[0-9]*' -print


      But without finding anything










      share|improve this question















      I'm trying to do at search for lots of folders contains ex. Events.1900-1990.events. I don't want folders ex. with Events.2004, only folders contains the years from 1900 -> 1990.



      The name Event can be anything, it could be birthdays, wars, etc..



      I know I should use regex, but I'm not an expert here :(



      I have tried something like this:



      find . -type d -regex '*/[a-z][A-Z]/19+[0-9]*' -print


      But without finding anything







      find regular-expression






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 8 at 9:57









      Jeff Schaller

      33.1k849111




      33.1k849111










      asked Sep 8 at 8:55









      SH1986

      264




      264




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          find . -type d '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')'


          This would find any directory in or under the current directory whose name contains any of the numbers 1900 through to 1990. The test is split in two on the file name where the first tests for numbers between 1900 and 1989, and the second test is for 1990.



          Regular expressions don't need to be used in this case. The patterns above are filename globbing patterns.



          If you want to add a test for a filename suffix .events, then you can do that in two ways:



          find . -type d -name '*.events' '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')' 

          find . -type d '(' -name '*19[0-8][0-9]*.events' -o -name '*1990*.events' ')'



          Your command will not find anything as a * at the start of a regular expression matches the character *. You also escape one of the [ in the expression, which makes it match the character [.






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467685%2ffind-folders-contains-names1900-1990names%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            find . -type d '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')'


            This would find any directory in or under the current directory whose name contains any of the numbers 1900 through to 1990. The test is split in two on the file name where the first tests for numbers between 1900 and 1989, and the second test is for 1990.



            Regular expressions don't need to be used in this case. The patterns above are filename globbing patterns.



            If you want to add a test for a filename suffix .events, then you can do that in two ways:



            find . -type d -name '*.events' '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')' 

            find . -type d '(' -name '*19[0-8][0-9]*.events' -o -name '*1990*.events' ')'



            Your command will not find anything as a * at the start of a regular expression matches the character *. You also escape one of the [ in the expression, which makes it match the character [.






            share|improve this answer


























              up vote
              1
              down vote



              accepted










              find . -type d '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')'


              This would find any directory in or under the current directory whose name contains any of the numbers 1900 through to 1990. The test is split in two on the file name where the first tests for numbers between 1900 and 1989, and the second test is for 1990.



              Regular expressions don't need to be used in this case. The patterns above are filename globbing patterns.



              If you want to add a test for a filename suffix .events, then you can do that in two ways:



              find . -type d -name '*.events' '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')' 

              find . -type d '(' -name '*19[0-8][0-9]*.events' -o -name '*1990*.events' ')'



              Your command will not find anything as a * at the start of a regular expression matches the character *. You also escape one of the [ in the expression, which makes it match the character [.






              share|improve this answer
























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                find . -type d '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')'


                This would find any directory in or under the current directory whose name contains any of the numbers 1900 through to 1990. The test is split in two on the file name where the first tests for numbers between 1900 and 1989, and the second test is for 1990.



                Regular expressions don't need to be used in this case. The patterns above are filename globbing patterns.



                If you want to add a test for a filename suffix .events, then you can do that in two ways:



                find . -type d -name '*.events' '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')' 

                find . -type d '(' -name '*19[0-8][0-9]*.events' -o -name '*1990*.events' ')'



                Your command will not find anything as a * at the start of a regular expression matches the character *. You also escape one of the [ in the expression, which makes it match the character [.






                share|improve this answer














                find . -type d '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')'


                This would find any directory in or under the current directory whose name contains any of the numbers 1900 through to 1990. The test is split in two on the file name where the first tests for numbers between 1900 and 1989, and the second test is for 1990.



                Regular expressions don't need to be used in this case. The patterns above are filename globbing patterns.



                If you want to add a test for a filename suffix .events, then you can do that in two ways:



                find . -type d -name '*.events' '(' -name '*19[0-8][0-9]*' -o -name '*1990*' ')' 

                find . -type d '(' -name '*19[0-8][0-9]*.events' -o -name '*1990*.events' ')'



                Your command will not find anything as a * at the start of a regular expression matches the character *. You also escape one of the [ in the expression, which makes it match the character [.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Sep 8 at 9:30

























                answered Sep 8 at 9:22









                Kusalananda

                107k14209331




                107k14209331



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467685%2ffind-folders-contains-names1900-1990names%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay