How to display folder tree structure in command line
tree
command line
windows
folder tree structure
To display the folder tree structure in the command line in Windows you can use the tree
command.
Tree
command allows the user to view a listing of files and folders in an easy to read listing way. The command is available in all Windows versions and MS-DOS OS.
Syntax
To see the command syntax and all possible parameters run the following command:
D:\> tree /?
Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
Examples
tree command without any parameters will display the structure of the current folder.
Here is the output of current folder including the files.
D:\admfactory.com>tree /F
Folder PATH listing for volume data
Volume serial number is 0000005D 1EBE:2B45
D:.
| archive.zip
| config.xml
| log.txt
|
├───dir1
| | f1.txt
| | f2.txt
| | f3.txt
| |
| └───dir3
| | f4.txt
| | f5.txt
| |
| └───dir4
| f6.txt
| f7.txt
|
├───dir10
| | f1.txt
| | f2.txt
| | f3.txt
| |
| └───dir3
| | f4.txt
| | f5.txt
| |
| └───dir4
| f6.txt
| f7.txt
|
├───dir2
| | f1.txt
| | f2.txt
| | f3.txt
| |
| └───dir3
| | f4.txt
| | f5.txt
| |
| └───dir4
| f6.txt
| f7.txt
|
└───dir3
| f1.txt
| f2.txt
| f3.txt
|
└───dir3
| f4.txt
| f5.txt
|
└───dir4
f6.txt
f7.txt