Monitoring

Tree – display directory hierarchies and filesystem information

Tree is a command-line utility that displays the contents of directories in a hierarchical, indented format. It provides a quick overview of a filesystem, showing how files and subdirectories are organized beneath a selected directory.

The program offers considerably more than a basic directory listing. It can display file metadata, filter entries by name, control recursion depth, and generate output in formats suitable for documentation or further processing.

Tree is particularly useful for examining project structures, understanding unfamiliar directory layouts, and producing a readable overview of large collections of files. Its extensive command-line options make it equally useful for interactive terminal work and shell scripts.

This is free and open source software.

Key Features

  • Displays recursive directory listings with hierarchical branch characters and colourized filenames.
  • Supports multiple starting directories and optional display of hidden files.
  • Limits traversal to a specified depth and can restrict output to directories only.
  • Displays file sizes, permissions, ownership, timestamps, and other filesystem metadata.
  • Supports human-readable and SI file size units.
  • Sorts entries by name, size, modification time, or version number, with reverse and directory-first ordering options.
  • Filters filenames and directories using inclusion and exclusion patterns.
  • Supports ignoring files according to Git ignore rules.
  • Displays symbolic link targets and optionally follows symbolic links during traversal.
  • Provides directory and file counts at the end of a listing.
  • Calculates cumulative directory sizes and prunes empty directories when requested.
  • Exports directory structures as HTML, XML, or JSON.
  • Can generate terminal hyperlinks for files and directories.
  • Reads directory listings from files or standard input instead of scanning the filesystem directly.
  • Supports custom output character sets, indentation styles, and colour configurations.

Website: oldmanprogrammer.net
Support:
Developer: Steve Baker
License: GNU General Public License v2.0

Tree is written in C. Learn C with our recommended free books and free tutorials.

Alternatives to tree


Explore Linux

Best Free and Open Source Software - A huge collection of recommended free and open source software covering every major category.
In-depth Linux Software Reviews - Detailed assessments of Linux software covering features, usability and overall quality.

The Big List of Active Linux Distros - An extensive collection of actively developed Linux distributions.
Open Source Alternatives - Alternatives to software and services from Google, Microsoft, Apple, Adobe, IBM, Autodesk, Oracle and others.
Essential Linux System Tools - Indispensable utilities for monitoring, maintaining and managing Linux systems.
Linux Productivity Tools - Useful utilities for improving productivity and streamlining everyday tasks.
Alternatives to Popular CLI Tools - Modern alternatives to familiar command-line utilities supplied with Linux systems.
Awesome Free Linux Game Tools - Tools, utilities and companion software that improve gaming on Linux.
Machine Learning on Linux - Machine learning and deep learning software, self-hosted applications and practical tools.
Saving Money with Linux - Practical ways to reduce electricity consumption and lower computing costs with Linux.
Linux Candy - Fun, entertaining and sometimes delightfully quirky software from the lighter side of Linux.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted