複数の条件で実行したいfind
のですが、たとえば、隠しファイルを除いてfooを検索します。
find . -type f \( -iname '*foo*' ! -name '.*' \)
Python コード:
import subprocess
cmd = ["find", ".", "-type", "f", "(", "-iname", "*foo*", "!", "-name", ".*", ")"]
sp = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print sp.communicate()[0].split()
誰かが私が欠けているものを説明できますか? ありがとう!