tree mac terminal code example

Example 1: osx tree

osx doesn't have tree, install by:
brew install tree

Example 2: terminal tree command

# yum install tree	 #RHEL/CentOS 7
# dnf install tree	 #Fedora 22+ and /RHEL/CentOS 8
$ sudo apt install tree	 #Ubuntu/Debian
# sudo zypper in tree 	 #openSUSE

Example 3: tree listing in mac

~/$ brew install tree==> Downloading http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz######################################################################## 100.0%==> make prefix=/usr/local/Cellar/tree/1.7.0 MANDIR=/usr/local/Cellar/tree/1.7.0/share/man/man1 CC=clang CFLAGS=-fomit-frame-pointer LDFLAGS= OBJS=tree.o unix.o html.o xml.o hash.o?  /usr/local/Cellar/tree/1.7.0: 7 files, 128K, built in 4 seconds~/$