Why is `find -name *.jks` not returning some files? [duplicate]

Multi tool use
Multi tool use

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











up vote
3
down vote

favorite













This question already has an answer here:



  • Why is my find not recursive?

    2 answers



find . -name *.jks -print 2>/dev/null


returns files of extension jks that do not have underscores as part of their name. Much to my surprise, I have just discovered that * does NOT substitute the underscore.



find . -name *_*.jks -print 2>/dev/null


returns files of extension jks that have one underscore.



How do I search for files that have 0 or more underscores? Using OSX Mountain Lion.







share|improve this question













marked as duplicate by goldilocks, Michael Mrozek♦ Apr 8 '14 at 14:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    Is your find supporting and logical operator? find . -name '*.jks' -a ! -name '*_*.jks'
    – manatwork
    Sep 17 '13 at 14:13










  • find . -name '*.jks' -print 2>/dev/null worked. you can submit an answer, @manatwork, and i will go ahead and accept it and up vote
    – amphibient
    Sep 17 '13 at 14:16










  • Your question is a bit strange: in my Linux (CentOS 5), your sample doesn't work. I have to write "*.jks". And, anyway, it returns all files with extension jks, with or without an underscore, that is what you are asking for.
    – AndrewQ
    Sep 17 '13 at 14:16










  • @AndrewQ, probably amphibient has no *.jks file in the work directory itself, so the wildcard is not expanded before the execution of find.
    – manatwork
    Sep 17 '13 at 14:17














up vote
3
down vote

favorite













This question already has an answer here:



  • Why is my find not recursive?

    2 answers



find . -name *.jks -print 2>/dev/null


returns files of extension jks that do not have underscores as part of their name. Much to my surprise, I have just discovered that * does NOT substitute the underscore.



find . -name *_*.jks -print 2>/dev/null


returns files of extension jks that have one underscore.



How do I search for files that have 0 or more underscores? Using OSX Mountain Lion.







share|improve this question













marked as duplicate by goldilocks, Michael Mrozek♦ Apr 8 '14 at 14:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    Is your find supporting and logical operator? find . -name '*.jks' -a ! -name '*_*.jks'
    – manatwork
    Sep 17 '13 at 14:13










  • find . -name '*.jks' -print 2>/dev/null worked. you can submit an answer, @manatwork, and i will go ahead and accept it and up vote
    – amphibient
    Sep 17 '13 at 14:16










  • Your question is a bit strange: in my Linux (CentOS 5), your sample doesn't work. I have to write "*.jks". And, anyway, it returns all files with extension jks, with or without an underscore, that is what you are asking for.
    – AndrewQ
    Sep 17 '13 at 14:16










  • @AndrewQ, probably amphibient has no *.jks file in the work directory itself, so the wildcard is not expanded before the execution of find.
    – manatwork
    Sep 17 '13 at 14:17












up vote
3
down vote

favorite









up vote
3
down vote

favorite












This question already has an answer here:



  • Why is my find not recursive?

    2 answers



find . -name *.jks -print 2>/dev/null


returns files of extension jks that do not have underscores as part of their name. Much to my surprise, I have just discovered that * does NOT substitute the underscore.



find . -name *_*.jks -print 2>/dev/null


returns files of extension jks that have one underscore.



How do I search for files that have 0 or more underscores? Using OSX Mountain Lion.







share|improve this question














This question already has an answer here:



  • Why is my find not recursive?

    2 answers



find . -name *.jks -print 2>/dev/null


returns files of extension jks that do not have underscores as part of their name. Much to my surprise, I have just discovered that * does NOT substitute the underscore.



find . -name *_*.jks -print 2>/dev/null


returns files of extension jks that have one underscore.



How do I search for files that have 0 or more underscores? Using OSX Mountain Lion.





This question already has an answer here:



  • Why is my find not recursive?

    2 answers









share|improve this question












share|improve this question




share|improve this question








edited Sep 17 '13 at 22:22









Gilles

504k1199961522




504k1199961522









asked Sep 17 '13 at 14:07









amphibient

4,39483467




4,39483467




marked as duplicate by goldilocks, Michael Mrozek♦ Apr 8 '14 at 14:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by goldilocks, Michael Mrozek♦ Apr 8 '14 at 14:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1




    Is your find supporting and logical operator? find . -name '*.jks' -a ! -name '*_*.jks'
    – manatwork
    Sep 17 '13 at 14:13










  • find . -name '*.jks' -print 2>/dev/null worked. you can submit an answer, @manatwork, and i will go ahead and accept it and up vote
    – amphibient
    Sep 17 '13 at 14:16










  • Your question is a bit strange: in my Linux (CentOS 5), your sample doesn't work. I have to write "*.jks". And, anyway, it returns all files with extension jks, with or without an underscore, that is what you are asking for.
    – AndrewQ
    Sep 17 '13 at 14:16










  • @AndrewQ, probably amphibient has no *.jks file in the work directory itself, so the wildcard is not expanded before the execution of find.
    – manatwork
    Sep 17 '13 at 14:17












  • 1




    Is your find supporting and logical operator? find . -name '*.jks' -a ! -name '*_*.jks'
    – manatwork
    Sep 17 '13 at 14:13










  • find . -name '*.jks' -print 2>/dev/null worked. you can submit an answer, @manatwork, and i will go ahead and accept it and up vote
    – amphibient
    Sep 17 '13 at 14:16










  • Your question is a bit strange: in my Linux (CentOS 5), your sample doesn't work. I have to write "*.jks". And, anyway, it returns all files with extension jks, with or without an underscore, that is what you are asking for.
    – AndrewQ
    Sep 17 '13 at 14:16










  • @AndrewQ, probably amphibient has no *.jks file in the work directory itself, so the wildcard is not expanded before the execution of find.
    – manatwork
    Sep 17 '13 at 14:17







1




1




Is your find supporting and logical operator? find . -name '*.jks' -a ! -name '*_*.jks'
– manatwork
Sep 17 '13 at 14:13




Is your find supporting and logical operator? find . -name '*.jks' -a ! -name '*_*.jks'
– manatwork
Sep 17 '13 at 14:13












find . -name '*.jks' -print 2>/dev/null worked. you can submit an answer, @manatwork, and i will go ahead and accept it and up vote
– amphibient
Sep 17 '13 at 14:16




find . -name '*.jks' -print 2>/dev/null worked. you can submit an answer, @manatwork, and i will go ahead and accept it and up vote
– amphibient
Sep 17 '13 at 14:16












Your question is a bit strange: in my Linux (CentOS 5), your sample doesn't work. I have to write "*.jks". And, anyway, it returns all files with extension jks, with or without an underscore, that is what you are asking for.
– AndrewQ
Sep 17 '13 at 14:16




Your question is a bit strange: in my Linux (CentOS 5), your sample doesn't work. I have to write "*.jks". And, anyway, it returns all files with extension jks, with or without an underscore, that is what you are asking for.
– AndrewQ
Sep 17 '13 at 14:16












@AndrewQ, probably amphibient has no *.jks file in the work directory itself, so the wildcard is not expanded before the execution of find.
– manatwork
Sep 17 '13 at 14:17




@AndrewQ, probably amphibient has no *.jks file in the work directory itself, so the wildcard is not expanded before the execution of find.
– manatwork
Sep 17 '13 at 14:17










1 Answer
1






active

oldest

votes

















up vote
11
down vote



accepted










all versions of find that I know will match underscores with wildcards.



be warned that when doing.



find . -name *.jks -print 2>/dev/null


the "*.jks" might get expanded by the shell, before running the find command.



e.g.



$ mkdir foo
$ touch a.jks foo/a.jks foo/b.jks
a.jks
$ find . -name *.jks -print
./a.jks
./foo/a.jks


this is really because you are actually calling find . -name a.jks -print, and thus it will not find e.g. b.jks.



if you quote the wildcard expression, you might have more luck:



$ find . -name "*.jks" -print
./a.jks
./foo/a.jks
./foo/b.jks


i'm pretty sure that running



$ find . -name "*.jks" -print


will give you all files with and without underscores.






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    11
    down vote



    accepted










    all versions of find that I know will match underscores with wildcards.



    be warned that when doing.



    find . -name *.jks -print 2>/dev/null


    the "*.jks" might get expanded by the shell, before running the find command.



    e.g.



    $ mkdir foo
    $ touch a.jks foo/a.jks foo/b.jks
    a.jks
    $ find . -name *.jks -print
    ./a.jks
    ./foo/a.jks


    this is really because you are actually calling find . -name a.jks -print, and thus it will not find e.g. b.jks.



    if you quote the wildcard expression, you might have more luck:



    $ find . -name "*.jks" -print
    ./a.jks
    ./foo/a.jks
    ./foo/b.jks


    i'm pretty sure that running



    $ find . -name "*.jks" -print


    will give you all files with and without underscores.






    share|improve this answer



























      up vote
      11
      down vote



      accepted










      all versions of find that I know will match underscores with wildcards.



      be warned that when doing.



      find . -name *.jks -print 2>/dev/null


      the "*.jks" might get expanded by the shell, before running the find command.



      e.g.



      $ mkdir foo
      $ touch a.jks foo/a.jks foo/b.jks
      a.jks
      $ find . -name *.jks -print
      ./a.jks
      ./foo/a.jks


      this is really because you are actually calling find . -name a.jks -print, and thus it will not find e.g. b.jks.



      if you quote the wildcard expression, you might have more luck:



      $ find . -name "*.jks" -print
      ./a.jks
      ./foo/a.jks
      ./foo/b.jks


      i'm pretty sure that running



      $ find . -name "*.jks" -print


      will give you all files with and without underscores.






      share|improve this answer

























        up vote
        11
        down vote



        accepted







        up vote
        11
        down vote



        accepted






        all versions of find that I know will match underscores with wildcards.



        be warned that when doing.



        find . -name *.jks -print 2>/dev/null


        the "*.jks" might get expanded by the shell, before running the find command.



        e.g.



        $ mkdir foo
        $ touch a.jks foo/a.jks foo/b.jks
        a.jks
        $ find . -name *.jks -print
        ./a.jks
        ./foo/a.jks


        this is really because you are actually calling find . -name a.jks -print, and thus it will not find e.g. b.jks.



        if you quote the wildcard expression, you might have more luck:



        $ find . -name "*.jks" -print
        ./a.jks
        ./foo/a.jks
        ./foo/b.jks


        i'm pretty sure that running



        $ find . -name "*.jks" -print


        will give you all files with and without underscores.






        share|improve this answer















        all versions of find that I know will match underscores with wildcards.



        be warned that when doing.



        find . -name *.jks -print 2>/dev/null


        the "*.jks" might get expanded by the shell, before running the find command.



        e.g.



        $ mkdir foo
        $ touch a.jks foo/a.jks foo/b.jks
        a.jks
        $ find . -name *.jks -print
        ./a.jks
        ./foo/a.jks


        this is really because you are actually calling find . -name a.jks -print, and thus it will not find e.g. b.jks.



        if you quote the wildcard expression, you might have more luck:



        $ find . -name "*.jks" -print
        ./a.jks
        ./foo/a.jks
        ./foo/b.jks


        i'm pretty sure that running



        $ find . -name "*.jks" -print


        will give you all files with and without underscores.







        share|improve this answer















        share|improve this answer



        share|improve this answer








        edited Nov 6 '13 at 13:50


























        answered Sep 17 '13 at 14:20









        umläute

        4,4151332




        4,4151332












            ghMZZjNkyHt5noZ6QIHqXQin,So
            d,1FGu cazwp FBfjQiGtWMh5V,rR5,cJa1XiBabM3Yh3 V5VX0pk,ECwsGB gKbgPTSZVot4d2wulpSbo,54QObuR

            Popular posts from this blog

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

            How many registers does an x86_64 CPU actually have?

            Displaying single band from multi-band raster using QGIS