Tuesday, 15 January 2013

bash - How to combine find with custom tests? -


I'm trying to learn the Linux command line, but I understand the find command The problem is happening.

I would like to list all those directories containing the directory .hg

This list lists all the directories:

  search-type D   

and this is the test that I want to do:

  [-d .hg]   

Find the man page: Find [ H] [-L] [-P] [path ...] [According to expression]

Where expression is included in the test but it is:

  Search-type d [-d. Hg]   

does not work.

Is the syntax right here? I'm sorry that this is such a primary question, but I have no one to ask.

Do this: Find -Type D-XAC Test - "{} / .hg" ';' -print

Then it looks for directories and each one of them examines the existence of Dior .hg . It prints only those people who come back right.

You can find it.

Test
  $ mkdir t1 $ mkdir -p t2 / .hg $ MKDIR-PT3 / T4 /. Find $ Hg-type D-XAC test- "{} / .hg" ';' -print ./t2 ./t3/t4    

No comments:

Post a Comment