Display The Contents Of A Directory As A Tree

The exa utility is a speedy replacement for ls that offers some additional features. One of those extra features is the tree display.

By including the -T (or --tree) flag, exa will recurse into a directory and display the entirety of the contents as a tree.

❯ exa -T
.
β”œβ”€β”€ folder1
β”‚  β”œβ”€β”€ cats
β”‚  β”‚  └── sneaky
β”‚  └── dogs
β”‚     └── fido
└── folder2
   β”œβ”€β”€ cats
   β”‚  β”œβ”€β”€ oreo
   β”‚  └── sneaky
   └── dogs
      └── fido

You can target a specific directory:

❯ exa -T folder2
folder2
β”œβ”€β”€ cats
β”‚  β”œβ”€β”€ oreo
β”‚  └── sneaky
└── dogs
   └── fido

See man exa for more details.

Last updated

Was this helpful?