Odpowiedzi:
Po prostu podajesz wszystkie wzorce do -Ipolecenia, oddzielając je |. Z strony podręcznika:
-P pattern
List only those files that match the wild-card pattern. Note:
you must use the -a option to also consider those files begin‐
ning with a dot `.' for matching. Valid wildcard operators are
`*' (any zero or more characters), `?' (any single character),
`[...]' (any single character listed between brackets (optional
- (dash) for character range may be used: ex: [A-Z]), and
`[^...]' (any single character not listed in brackets) and `|'
separates alternate patterns.
-I pattern
Do not list those files that match the wild-card pattern.
Na przykład
tree -I 'test*|docs|bin|lib'
pomija „docs”, „bin” i „lib”, katalogi i dowolny katalog z „test” w nazwie, niezależnie od tego, gdzie znajdują się w hierarchii katalogów. Oczywiście możesz zastosować symbole wieloznaczne, aby uzyskać o wiele silniejsze dopasowanie.
docs/subdoc/wykluczyć taki podkatalog ?
tree --prune -P '*.html'katalogi, ale tylko te z .htmlplikami.