| 场景 | 生成目录结构清单文件 |
|---|---|
| 工具 | tree -L -I > 文件 / find 兜底 |
| 深度 | -L 2~3 级通常足够 |
常用示例
常用示例
tree -L 3 -I 'node_modules|.git|dist' /data/app > structure.txt
# 没有 tree 时:
find /data/app -maxdepth 3 -not -path '*/.git/*' | sort > structure.txt交接、评审、排障时附一份带层级控制的目录结构:tree -L 限深度,排除依赖目录避免噪音。
| 场景 | 生成目录结构清单文件 |
|---|---|
| 工具 | tree -L -I > 文件 / find 兜底 |
| 深度 | -L 2~3 级通常足够 |
tree -L 3 -I 'node_modules|.git|dist' /data/app > structure.txt
# 没有 tree 时:
find /data/app -maxdepth 3 -not -path '*/.git/*' | sort > structure.txt