find command does not return a match for a file in a subdirectory, occasionally [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|improve this 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




    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










  • It's also worth trying -noleaf
    – Tavian Barnes
    Oct 16 '17 at 18:51














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?







share|improve this 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




    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










  • It's also worth trying -noleaf
    – Tavian Barnes
    Oct 16 '17 at 18:51












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?







share|improve this question












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?









share|improve this question











share|improve this question




share|improve this question










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




    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










  • It's also worth trying -noleaf
    – Tavian Barnes
    Oct 16 '17 at 18:51












  • 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, 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










  • 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















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

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