DEV Community

box
box

Posted on

1

Display Dir Structure in Tree Format.

Environment

  • Mac

    • CPU: Apple M4
    • OS: Sequoia 15.1.1
  • Zsh

    • Version: 5.9
  • Homebrew

    • Version: 4.4.10

Sample

Run the following command to create the sample directories and files.

mkdir -p ./dir1/dir2
touch ./file0.txt ./dir1/file1.txt ./dir1/dir2/file2.txt
Enter fullscreen mode Exit fullscreen mode

Flow

  1. Install tree command.

    brew install tree
    

    We can check the version of this command by running the following command.

    tree --version
    

    As of the time of writing, the version is 2.2.1.

  2. Run the command.

    tree
    

    The result is as follow.

    .
    ├── dir1
    │   ├── dir2
    │   │   └── file2.txt
    │   └── file1.txt
    └── file0.txt
    

Manual

Running the following command will display the manual page for the tree command in Zsh.

man tree
Enter fullscreen mode Exit fullscreen mode

After reading, press the q key to return to Zsh.

The source for tree v2.2.1 manual is here.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more