0

How can you find files name 'xyz' under directories name 'abc'?

something like this....but its not working.

find . -type d -name 'abc' -exec find {} -type f -name 'xyz' \;

find . -not -path 'abc' -prune -o -type f -name 'xyz'

I can't just find files based on their name alone, b/c multiple directories NOT named 'abc' will have a file w/ the name 'xyz'

1
  • think I actually got it. find . -type f -name "xyz" -path "abc"
    – veilig
    Commented Aug 5, 2014 at 0:37

1 Answer 1

0

I think you could do

root@localhost:~# find /home/ -type f -name 'authorized_keys' -path '*/.ssh/*'

where

  • .ssh is your directory abc
  • authorized_keys is your file name xyz
  • /home/ is your starting directory .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .