Why is `find -name *.jks` not returning some files? [duplicate]
Clash 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.
find wildcards
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.
add a comment |Â
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.
find wildcards
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 yourfind
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 offind
.
â manatwork
Sep 17 '13 at 14:17
add a comment |Â
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.
find wildcards
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
find wildcards
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 yourfind
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 offind
.
â manatwork
Sep 17 '13 at 14:17
add a comment |Â
1
Is yourfind
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 offind
.
â 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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
edited Nov 6 '13 at 13:50
answered Sep 17 '13 at 14:20
umläute
4,4151332
4,4151332
add a comment |Â
add a comment |Â
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