Sometimes its very useful to see the directory tree is a clear format on the console. For example, in a situation where you’ld like to see the structure of a software project. Linux has several utilities to do that and some of them come with additional information. This article explores three such tools. All of these have a common ability to display only the directories if that’s what you need.

1. tree

The most common utility with a very clean output. It has many useful options like set display depth, show or ignore files matching a wildcard pattern, follow symbolic link etc.

$ tree . ├── 3.19.0 │ ├── linux-headers-3.19.0-031900_3.19.0-031900.201502091451_all.deb │ ├── linux-headers-3.19.0-031900-generic_3.19.0-031900.201502091451_amd64.deb │ └── linux-image-3.19.0-031900-generic_3.19.0-031900.201502091451_amd64.deb ├── pms-mods │ ├── LICENSE │ ├── pms_audacious.py │ ├── pms_smplayer.py │ └── README.md ├── vibrancy-colors_1.1~trusty~Noobslab.com_all.deb └── Yandex_201501.deb 2 directories, 9 files

To install tree on Ubuntu:

$ sudo apt-et install tree

2. ddir

Displays the hierarchical directory tree. Can exclude files matching a regexp pattern.

$ ddir . . Yandex_201501.deb vibrancy-colors_1.1~trusty~Noobslab.com_all.deb +--3.19.0/ | linux-headers-3.19.0-031900-generic_3.19.0-031900.201502091451_amd64.deb | linux-headers-3.19.0-031900_3.19.0-031900.201502091451_all.deb | linux-image-3.19.0-031900-generic_3.19.0-031900.201502091451_amd64.deb +--pms-mods/ .gitignore LICENSE README.md pms_audacious.py pms_smplayer.py

To install ddir on Ubuntu:

$ sudo apt-get install ddir

3. ncdt

ncdt shows the size of files as well as the cumulative size of directories. It can also detect mp3s and show the bitrate.

$ ncdt `-- [133,147,947] . |-- [ 43,503,384] Yandex_201501.deb |-- [ 69,551,926] 3.19.0 | |-- [ 13,366,288] linux-headers-3.19.0-031900_3.19.0-031900.201502091451_all.deb | |-- [ 1,157,678] linux-headers-3.19.0-031900-generic_3.19.0-031900.201502091451_amd64.deb | `-- [ 55,027,960] linux-image-3.19.0-031900-generic_3.19.0-031900.201502091451_amd64.deb |-- [ 20,032,472] vibrancy-colors_1.1~trusty~Noobslab.com_all.deb `-- [ 60,165] pms-mods |-- [ 9,398] pms_smplayer.py |-- [ 35,108] LICENSE |-- [ 5,950] README.md |-- [ 310] .gitignore `-- [ 9,399] pms_audacious.py

To install ncdt on Ubuntu:

$ sudo apt-get install ncdt

If you are looking for something similar to view the process tree, run pstree.