Bha*_*nha 133 command-line patterns tree
我需要打印我们生产系统的目录结构,我想从树中删除一些特定的目录?
我们如何为tree命令指定多个忽略模式?
ire*_*ses 187
您只需向-I命令提供所有模式,以|. 从联机帮助页:
-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.
Run Code Online (Sandbox Code Playgroud)
所以,例如
tree -I 'test*|docs|bin|lib'
Run Code Online (Sandbox Code Playgroud)
跳过“docs”、“bin”和“lib”目录以及名称中带有“test”的任何目录,无论它们位于目录层次结构中的何处。显然,您可以应用通配符来实现更强大的匹配。
| 归档时间: |
|
| 查看次数: |
43495 次 |
| 最近记录: |