The tree command allows users to view an easy-to-read list of files and folders.
Availability
Tree is an external command available for the following Microsoft operating systems as tree.com.
Availability
Tree syntax
Tree examples
All Versions of MS-DOS
Windows 2000
Windows XP
Windows Vista
Windows 7
Windows 8
Windows 10
Windows 11
Tree syntax
Windows 10 and 11 syntax
TREE [Drive:][Path] [/F] [/A]
Windows 8 and earlier syntax
Tree examples
The tree command typed alone produces a listing and overview of the current directory (shown in the image to the right).
- Windows 10 and 11 syntax.
- Windows 8 and earlier syntax.
tree
In the example, C: is the current directory, “banners” is one of the directories, and “big” is a subdirectory of the “cdn” directory.
tree /F
The command above uses the tree command with the /F switch. The resulting output would include the names of files located in each of the directories in the tree. Depending on how many files are located in each directory, the tree listing could be quite long.
- See our tree structure definition if you need further information on the structure of a tree.
To output the structure of a directory to a file, and other options, try using the dir command.