---
title: "列出目录结构并排除一个或多个目录"
description: "想过在显示当前目录结构时排除一两个目录吗？"
canonical: https://oozou.com/til/list-directory-structure-except-one-or-more-dirs-24
locale: zh-Hans
date: 2020-10-13
topic: shell
---

# 列出目录结构并排除一个或多个目录

> 想过在显示当前目录结构时排除一两个目录吗？

Published: 2020-10-13 · Topic: [shell](https://oozou.com/zh-Hans/til-topics/shell) ([markdown](https://oozou.com/zh-Hans/til-topics/shell.md))

想过在显示当前目录结构时排除一两个目录吗？

```shell
#NPM or yarn project
tree -I node_modules
```

```shell
# Elixir Mix project
tree -I 'deps|test'
```

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/zh-Hans/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
