tree

What is tree?

tree is a unix tool that can be used to list directories and/or files or only directories in a structured format.

How to use tree

# syntax "options" and "directory" is optional
tree <options> <directory>

tree ./ # show all files/directory, starting from the current directory you're in.
tree -d ./ # show all directory, starting from the current directory you're in.
tree -a ./ # show all files, starting from the current directory you're in.
tree -F ./ # Appends '/', '=', '*', '@', '|' or '>' as per ls -F.
tree --inodes ./ # print inode number of each file

tree example

root@Corrosie:~/Documents/Hacking/Post_Exploitation# tree ./
./
└── Priv_escalation
    ├── Linux
    │   ├── les.sh
    │   └── linuxenum.sh
    └── Windows
        ├── Powershell
        │   └── Sherlock
        │       ├── LICENSE
        │       ├── README.md
        │       ├── Sherlock.ps1
        │       └── Usage
        └── Windows-Exploit-Suggester
            ├── 2019-10-22-mssb.xls
            ├── LICENSE.md
            ├── README.md
            └── windows-exploit-suggester.py

6 directories, 10 files

Last updated