MS-DOS and Windows command line tree command
The tree command allows the user to view an easy-to-read list of files and folders.
Tree is an external command that is available for the following Microsoft operating systems as tree.com.
TREE [Drive:[[Path] [/F] [/A]
|Drive:\Path||Drive and directory containing disk for the display of directory structure.|
|/F||Displays the file names contained in each directory.|
|/A||Extended characters used for linking lines instead of graphic characters. /a is used with code pages that do not support graphics characters and to send output to printers that do not properly interpret graphics characters.|
The tree command typed alone produces a listing and overview of the current directory (shown in the image to the right).
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.