find command does not return a match for a file in a subdirectory, occasionally [closed]
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
When searching for a particular file:
The find
command returns no output when executed from a parent directory:
find path-to/subdirectory -name <filename> # No match found
But, it returns a match when executed after entering the sub directory:
cd path-to/subdirectory
find . -name <filename> # Match found
This happens only for a few files.
I was able to confirm this behaviour because ls -l */*/<filename>
would show more matches than find . -name <filename>
Does anyone know a possible reason for this behavior?
find ls
closed as too broad by Gilles, Archemar, Stephen Rauch, Jeff Schaller, Anthon Oct 16 '17 at 2:30
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |Â
up vote
2
down vote
favorite
When searching for a particular file:
The find
command returns no output when executed from a parent directory:
find path-to/subdirectory -name <filename> # No match found
But, it returns a match when executed after entering the sub directory:
cd path-to/subdirectory
find . -name <filename> # Match found
This happens only for a few files.
I was able to confirm this behaviour because ls -l */*/<filename>
would show more matches than find . -name <filename>
Does anyone know a possible reason for this behavior?
find ls
closed as too broad by Gilles, Archemar, Stephen Rauch, Jeff Schaller, Anthon Oct 16 '17 at 2:30
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
3
Does<filename>
contain any shell glob characters? are you protecting it with quotes?
â steeldriver
Oct 15 '17 at 14:20
4
Ispath-to
, orpath-to/subdirectory
a symbolic link?
â Hauke Laging
Oct 15 '17 at 14:32
Or possibly an automounted directory such thatcd path-to/subdirectory
triggers the mount?
â Tavian Barnes
Oct 15 '17 at 21:06
It's also worth trying-noleaf
â Tavian Barnes
Oct 16 '17 at 18:51
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
When searching for a particular file:
The find
command returns no output when executed from a parent directory:
find path-to/subdirectory -name <filename> # No match found
But, it returns a match when executed after entering the sub directory:
cd path-to/subdirectory
find . -name <filename> # Match found
This happens only for a few files.
I was able to confirm this behaviour because ls -l */*/<filename>
would show more matches than find . -name <filename>
Does anyone know a possible reason for this behavior?
find ls
When searching for a particular file:
The find
command returns no output when executed from a parent directory:
find path-to/subdirectory -name <filename> # No match found
But, it returns a match when executed after entering the sub directory:
cd path-to/subdirectory
find . -name <filename> # Match found
This happens only for a few files.
I was able to confirm this behaviour because ls -l */*/<filename>
would show more matches than find . -name <filename>
Does anyone know a possible reason for this behavior?
find ls
asked Oct 15 '17 at 14:01
Nagaraj
111
111
closed as too broad by Gilles, Archemar, Stephen Rauch, Jeff Schaller, Anthon Oct 16 '17 at 2:30
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by Gilles, Archemar, Stephen Rauch, Jeff Schaller, Anthon Oct 16 '17 at 2:30
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
3
Does<filename>
contain any shell glob characters? are you protecting it with quotes?
â steeldriver
Oct 15 '17 at 14:20
4
Ispath-to
, orpath-to/subdirectory
a symbolic link?
â Hauke Laging
Oct 15 '17 at 14:32
Or possibly an automounted directory such thatcd path-to/subdirectory
triggers the mount?
â Tavian Barnes
Oct 15 '17 at 21:06
It's also worth trying-noleaf
â Tavian Barnes
Oct 16 '17 at 18:51
add a comment |Â
3
Does<filename>
contain any shell glob characters? are you protecting it with quotes?
â steeldriver
Oct 15 '17 at 14:20
4
Ispath-to
, orpath-to/subdirectory
a symbolic link?
â Hauke Laging
Oct 15 '17 at 14:32
Or possibly an automounted directory such thatcd path-to/subdirectory
triggers the mount?
â Tavian Barnes
Oct 15 '17 at 21:06
It's also worth trying-noleaf
â Tavian Barnes
Oct 16 '17 at 18:51
3
3
Does
<filename>
contain any shell glob characters? are you protecting it with quotes?â steeldriver
Oct 15 '17 at 14:20
Does
<filename>
contain any shell glob characters? are you protecting it with quotes?â steeldriver
Oct 15 '17 at 14:20
4
4
Is
path-to
, or path-to/subdirectory
a symbolic link?â Hauke Laging
Oct 15 '17 at 14:32
Is
path-to
, or path-to/subdirectory
a symbolic link?â Hauke Laging
Oct 15 '17 at 14:32
Or possibly an automounted directory such that
cd path-to/subdirectory
triggers the mount?â Tavian Barnes
Oct 15 '17 at 21:06
Or possibly an automounted directory such that
cd path-to/subdirectory
triggers the mount?â Tavian Barnes
Oct 15 '17 at 21:06
It's also worth trying
-noleaf
â Tavian Barnes
Oct 16 '17 at 18:51
It's also worth trying
-noleaf
â Tavian Barnes
Oct 16 '17 at 18:51
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
3
Does
<filename>
contain any shell glob characters? are you protecting it with quotes?â steeldriver
Oct 15 '17 at 14:20
4
Is
path-to
, orpath-to/subdirectory
a symbolic link?â Hauke Laging
Oct 15 '17 at 14:32
Or possibly an automounted directory such that
cd path-to/subdirectory
triggers the mount?â Tavian Barnes
Oct 15 '17 at 21:06
It's also worth trying
-noleaf
â Tavian Barnes
Oct 16 '17 at 18:51