Install tree command in MacOS

In this article I’ll show you how to install tree command in MacOS.

We are gonna install tree using Homebrew. Homebrew is an open source package manager for MacOS and Linux. Read this article to know how to install Homebrew on MacOS

If you have brew in your machine, run the following command in the terminal to install tress

$ brew install tree

The above command will install tree command in your Mac and you will see logs like this.

$ brew install tree
Updating Homebrew…
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
pnetcdf wagyu
==> Updated Formulae

==> Downloading https://homebrew.bintray.com/bottles/tree-1.8.0.mojave.bottle.tar.gz

################################################################## 100.0%

==> Pouring tree-1.8.0.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/tree/1.8.0: 8 files, 117KB

To test the installation, enter the following command in the terminal

tree -d

It will show the directory listing like this

β”œβ”€β”€ alvin
β”‚   β”œβ”€β”€ pycache
β”‚   └── migrations
└── mytrip
└── pycache

5 directories

Post navigation

Alvin Jaison

Myself Alvin Jaison. I'm a DevOps Engineer by Profession; A Mountaineer by Passion. I started this website to share DevOps related posts. Post your suggestions as a comment. You can reach me @ alvinjaison@outlook.com

Leave a Reply

Your email address will not be published. Required fields are marked *