tree like view of the folder in OS X

If you’d like visual view of the file system, and you are working with OSX, you can easily achieve that via CLI using “tree” application.

You can download it from here

After unpacking source (in my case it was downloaded from here: just modify the Makefile inside tree-1.6.0 directory by commenting Linux section and uncommenting OS X section.

You want to comment these:

# Linux defaults:

You want to uncomment these:

# Uncomment for OS X:
CFLAGS=-O2 -Wall -fomit-frame-pointer -no-cpp-precomp

Then, all you have to do is call following commands:

mkdir ~/bin
cp tree ~/bin
chmod 0755 ~/bin/tree

And you can enjoy

└─[~/examples/git/ourfirstrepo] tree
├── index.html
└── subfolder
    └── index-two.html

In case you prefer ASCII only characters, use this one

└[~/workspace] tree tree_sample --charset=ascii
|-- a
|   `-- file_aa
|-- b
|-- c
|-- file_a
`-- file_b

I have found this tool accidentally while watching GIT tutorial :)

McCullough and Berglund on Mastering Git