---
title: "列出目錄結構並排除一個或多個目錄"
description: "想過在顯示目前目錄結構時排除一兩個目錄嗎？"
canonical: https://oozou.com/til/list-directory-structure-except-one-or-more-dirs-24
locale: zh-Hant
date: 2020-10-13
topic: shell
---

# 列出目錄結構並排除一個或多個目錄

> 想過在顯示目前目錄結構時排除一兩個目錄嗎？

Published: 2020-10-13 · Topic: [shell](https://oozou.com/zh-Hant/til-topics/shell) ([markdown](https://oozou.com/zh-Hant/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-Hant/contact

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