CMD Master
Back to Blog
Arnošt Havelka

Tree Command

Visualize directory structures graphically.

Start Interactive Lesson
Tree Command

Tree Command

The tree command allows you to view the folder structure of a drive or path graphically. It creates a "branching" visualization that makes it easy to understand the hierarchy of your directories and files.

Usage:tree
[drive:][path]
[/f]
[/a]
/f
Displays the names of the files in each folder.
/a
Uses ASCII text characters instead of extended characters (useful if lines look weird).

Common Options

Real-World Examples

1. Basic Directory Tree

View the structure of the current directory.

Command Prompt
C:\Users\User>tree

2. Showing Files

See exactly where files are located within the structure.

Command Prompt
C:\Users\User>tree /f

3. Saving the Tree to a File

This is great for documenting your project structure.

Command Prompt
C:\Users\User>tree /f > structure.txt

Knowledge Check

1 / 2

Which flag makes tree show files, not just folders?