Read more

Working on the Linux command line: Use the `tree` command instead of repeated `cd` and `ls`

Deleted user #4117
September 17, 2021Software engineer

The tree command will show you the contents of a directory and all it's sub directories as a tree:

>tree
.
├── a
│   ├── file_1.txt
│   └── file_2.txt
└── b
    ├── c
    │   └── even_more.txt
    └── more.txt

3 directories, 4 files
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

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 to makandra dev (2021-09-17 19:14)