The tree
command will show you the contents of a directory and all its sub directories as a tree:
>tree
.
├── a
│ ├── file_1.txt
│ └── file_2.txt
└── b
├── c
│ └── even_more.txt
└── more.txt
3 directories, 4 files
If you have deeply nested directories, the output will be quite long though. To avoid that, you can limit the depth, e.g. tree -L 2
will only go 2 directories deep.
If you use that regularly, consider adding aliases for that to your ~/.bashrc
:
alias tree2='tree -L 2'
alias tree3='tree -L 3'
Posted by Judith Roth to makandra dev (2021-09-17 17:14)