Linux Tree Command

May 29, 2017

The tree command list contents of directories in a tree-like format. I often use this to document directory structures of my projects. The output of tree is of course, the directory structure drawn in an ASCII art style tree. See example below. A few lines of comment are added to inform team mates or future self.

The tree command also allows a few useful flags.

  • tree -I bla_folter omits bla_folder from the tree.
  • tree -L 2 shows directory structure upto 2 level deep.
  • tree -d shows only directories in the tree.