bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to find all the files that satisfy one set of conditions in director


From: Peng Yu
Subject: How to find all the files that satisfy one set of conditions in directories that satisfies another set of conditions in one 'find' command?
Date: Mon, 25 Jun 2012 14:53:22 -0500

Hi,

I want find all the files that satisfy one set of conditions in
directories that satisfies another set of conditions in one 'find'
command. As an example, I want to search for executables in
directories that has a file named ".export".

As of now, I use the follow commands (to demonstrate ideas but are not
fully tested).

search_dirs=(`find . -type d -exec sh -c "test -f '{}'/.export" ';' -print`)
files=(`find "address@hidden" -mindepth 1 -maxdepth 1 -executable
-type f`)

Is there a more compact (but still readable way preform such search in
one find command?

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]