Create a Tree-View of a Directory on Linux with 'tree'

August 17, 2019

 This post shows you how to create a tree-view of a directory on Linux (Ubuntu).


Install and Use Tree


To create a tree view of a directory install tree by running sudo apt install tree


Type tree in the directory you'd like to list:


Type tree -d to just get directories:



Create this Directory


The demo tree structure was created using these commands:

mkdir ~/treedemo
cd ~/treedemo/
mkdir dir1
mkdir dir2
mkdir dir3
cd dir1
touch file1.txt
touch file2.txt
touch file3.txt
cd ../dir2
touch file4.txt



Type rm -rf ~/treedemo to remove the treedemo directory.





GNU image from [link]



Please reload

Our Recent Posts

DOE PAMS Specialties

September 5, 2020

Good Link for HOWTO Bring an Off-Screen Window Back Onto Screen for Windows 10, 8, 7, and Vista

September 5, 2020

Connect to and Control a Synaccess NPC-22 netCommander from Ubuntu 16.04.3 Running in a VirtualBox VM via a Prolific Technology Inc. USB to Serial Port Converter to Turn a Target On and Off

September 4, 2020

Please reload


Please reload


©2020 by Zach Pfeffer