tree

tree is a recursive directory listing command that produces a depth indented listing of files.

Installation

To install the latest version, use homebrew:

  1. brew install tree

Usage

Running tree will produce output like this:

  1. .
  2. ├── Apps
  3. ├── Octave.md
  4. ├── README.md
  5. ├── Settings.md
  6. ├── araxis-merge.jpg
  7. ├── beyond-compare.png
  8. ├── delta-walker.jpg
  9. ├── filemerge.png
  10. └── kaleidoscope.png
  11. ├── CONTRIBUTING.md
  12. ├── Cpp
  13. └── README.md
  14. ├── Docker
  15. └── README.md
  16. ├── Git
  17. ├── README.md
  18. └── gitignore.md
  19. └── Go
  20. └── README.md
  21. 5 directories, 14 files

To limit the recursion you can pass an -L flag and specify the maximum depth tree will use when searching.

  1. tree -L 1

will output:

  1. .
  2. ├── Apps
  3. ├── CONTRIBUTING.md
  4. ├── Cpp
  5. ├── Docker
  6. ├── Git
  7. └── Go
  8. 5 directories, 1 files