Category: Ubuntu

Added: 22nd of July 2020

Viewed: 154 times

Install the tree package to list folders and files in a tree like format inside the terminal on Linux

An interesting package I stumbled across a couple of weeks back called tree enables you to list your folders and files in a tree like format, listing via the terminal. Not only that but there are many other options such as outputting the tree to an .html or .xml file.

To install tree on your ubuntu based distribution enter the following command

sudo apt-get install tree


Once installed you can take a look at the options available by enterting the following command
tree --help


For the purposes of this tutorial I created a new folder, with subfolders and documents.

To start using tree, cd to a directory of your choice
cd test-folder


And then simply enter the tree command
tree


Here is the output
Enter the tree command to display folders and files as a tree

List of options available for the tree command can be found by entering the following command.
tree --help


Since you can output the folders, sub folder, files and images as .html, I could see the tree command being helpful if I had a hard drive full of images / photographs, and wanted a way to display them through your web browser, without needing to go through the file manager.

To do this you would enter the following command. The commands creates a new file named output.html
Please note: You must specify the full path to the directory

tree -H /home/username/Desktop/test-folder > output.html


Here is what output looks like to an .html file

Output directory listing to .html directory

Other Tips & Tutorials

Ubuntu

Download Microsoft Edge preview version for Ubuntu and Ubuntu based distributions

Posted: 22nd of October 2020

Views: 29

Ubuntu

Create a really simple banner using GIMP (GNU Image Manipulation Program) in Linux

Posted: 7th of August 2020

Views: 158

Ubuntu

Install the tree package to list folders and files in a tree like format inside the terminal on Linux

Posted: 22nd of July 2020

Views: 154

Ubuntu

Ubuntu 4.10, Warty Warthog. The first Ubuntu Linux Distribution

Posted: 6th of October 2019

Views: 953

Ubuntu

Sim City 4 Deluxe Edition Install Wine Linux. Trouble installing from CD/Disk 2

Posted: 19th of May 2019

Views: 1216

Ubuntu

Where are the fonts located in Ubuntu and other Ubuntu based distributions

Posted: 3rd of June 2018

Views: 1329

Ubuntu

Install MariaDB Database in Ubuntu and other Ubuntu based distributions (Part 1)

Posted: 26th of May 2018

Views: 1264

Ubuntu

Convert .mkv video to .png images using ffmpeg

Posted: 24th of May 2018

Views: 2600

Ubuntu

Shutdown Ubuntu using the terminal

Posted: 20th of May 2018

Views: 1137

Ubuntu

Running Sketchup 8 in Wine. Sketchup was unable to initialize OpenGL, Linux

Posted: 29th of May 2016

Views: 3559