tree命令

江南北

关注

阅读 46

2023-09-06


tree支持通配符,用tree可以快速显示项目下的源码文件目录结构,如:

 tree -L 6 -P "*.c"


tree - list contents of directories in a tree-like format.

 -L level
              Max display depth of the directory tree.

 -P pattern
              List only those files that match the wild-card pattern.  Note: you must use the -a option to also consider those files beginning with a dot `.'  for matching.  Valid wildcard operators are `*' (any zero or more charac‐
              ters),  `?'  (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.

精彩评论(0)

0 0 举报