“tree” Command on Mac OS X

So, I have been drawing the ASCII file structure tree by hand lately… and that is dumb and time consuming. After digging around, I found a great way to do so.

First, if you don’t have Homebrew, install it first.

Run the following command to install the tree command:-

brew install tree

Now, you can run the following command to create a tree:-

tree [directory]

For example:

tree testMe

… generates:-

├── src
├── testMe.iml
└── web
    ├── WEB-INF
    │   ├── lib
    │   └── web.xml
    └── index.jsp


Leave a Reply

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