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

http://mama.indstate.edu/users/ice/tree/

After unpacking source (in my case it was downloaded from here: http://mama.indstate.edu/users/ice/tree/src/tree-1.6.0.tgz) 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:
#CFLAGS=-ggdb -Wall -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
#CFLAGS=-O4 -Wall  -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
#LDFLAGS=-s

You want to uncomment these:

# Uncomment for OS X:
CC=cc
CFLAGS=-O2 -Wall -fomit-frame-pointer -no-cpp-precomp
LDFLAGS=
OBJS+=strverscmp.o

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

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

And you can enjoy

┌─[michalo@delta]───────────────────────────────────[20:00:30]
└─[~/examples/git/ourfirstrepo] tree
.
├── index.html
└── subfolder
    └── index-two.html

In case you prefer ASCII only characters, use this one

┌[michalo@pi]
└[~/workspace] tree tree_sample --charset=ascii
tree_sample
|-- 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