SUMMARY: Display a directory's subdirectories and (optionally) all files contained therein.
Ever need to output a list of all the directories and subdirectories on a particular hard drive or removable media? The tree command does just that, and you can pipe the results to a text file for further manipulation or printing.
To view all of the directories and subdirectories on a device, just cd\ to the root of your drive and then execute the tree command. Else, only the subdirectories of the current directory will be displayed.
The following parameters modify the output:
This outputs all files contained in the current directory and subdirectories. Issuing this command from the root directory can show all non-hidden files on the current drive, so the output may be long!
By default, the treecommand uses simple graphics to signify subdirectories. If you are having trouble processing or printing the results, add this parameter to display ASCII characters.
The following example command, executed from the root directory of a hard drive or removable media, creates a text file tree.txt containing all non-hidden files and folders. This may take a while to process, so be patient!
tree /f > tree.txt
Return to the Windows XP and DOS page.
The MalekTips website was created in 1998 by Andrew Malek of Envision Programming. The page's goal is to freely disperse computer-related tips, hints, and informative articles. Tips are organized to be easy to find, and are presented clearly, in easy-to-understand language.