Ever been working your way down directories with alternating
and ls
? Not knowing by heart what the whole directory structure looks like can be a pain. But there is a way out with the tree command!cd
This post is part of a series on command line tools. The goal is to get you started with this command if you recognise yourself in the situation above.
Installation
For mac use homebrew:
brew install tree
Command
There is not much to it. Here are the command I use the most. For the whole tree structure say this:

But sometimes the output is overwhelming and you only want to know a few levels down.

I hope the tree command will save you some pain in navigating through your directories. Happy treeing!