Linux – Pretty print folder structure using linux terminal

linuxterminalUbuntu

How can you pretty print a directory structure with all subdirectories to the deepest level in the linux terminal(ubuntu)?
This is an example of such a pretty print output for a mysite folder:

mysite
|-- manage.py
|-- mysite
    |-- __init__.py
    |-- settings.py
    |-- urls.py
    |-- wsgi.py
|-- polls
    |-- __init__.py
    |-- models.py
    |-- tests.py
    |-- views.py
    |-- static
        |-- css
            |-- styles.css
|-- templates
    |-- polls
        |-- index.html

Best Answer

You can use the tree command. You might need to install it if it is not already installed.