tree
January 3, 2020  |  Linux

Since I switched from macOS to Linux, I keep discovering new CLI tools and re-discovering some old ones. Here is one of the forgotten ones: tree.

tree
.
├── config
│   └── filebeat
│       └── filebeat.yml
├── docker-compose.yml
└── README.md

It’s very simple but super convenient. It allows users to see a complete structure of any directory without checking each sub-folder manually, and it’s output can be customized. For instance, we can add -h argument in order to show the size of each file in the output:

tree -h
.
├── [4.0K]  100MSDCF
│   ├── [ 24M]  DSC00265.ARW
│   ├── [4.9M]  DSC00265.JPG
├── [517K]  2020-01.pdf
├── [4.0K]  DCIM
│   └── [ 12K]  100MSDCF
│       ├── [ 24M]  DSC00073.ARW
│       ├── [ 24M]  DSC00074.ARW
│       ├── [ 24M]  DSC00075.ARW
├── [4.0K]  raspbian
│   ├── [2.1G]  2019-09-26-raspbian-buster-lite-custom.img
│   ├── [2.1G]  2019-09-26-raspbian-buster-lite.img
│   └── [433M]  2019-09-26-raspbian-buster-lite.zip
└── [ 420]  rename-photos.sh