treetree

以图形方式显示驱动器路径或磁盘的目录结构。Displays the directory structure of a path or of the disk in a drive graphically. 此命令显示的结构取决于你在命令提示符处指定的参数。The structure displayed by this command depends upon the parameters that you specify at the command prompt. 如果未指定驱动器或路径,此命令将显示从当前驱动器的当前目录开始的树状结构。If you don't specify a drive or path, this command displays the tree structure beginning with the current directory of the current drive.

语法Syntax

tree [<drive>:][<path>] [/f] [/a]

参数Parameters

参数Parameter 说明Description
<drive>: 指定包含要显示其目录结构的磁盘的驱动器。Specifies the drive that contains the disk for which you want to display the directory structure.
<path> 指定要显示其目录结构的目录。Specifies the directory for which you want to display the directory structure.
/f/f 显示每个目录中的文件的名称。Displays the names of the files in each directory.
/a/a 指定使用文本字符而不是图形字符来显示链接子目录的行。Specifies to use text characters instead of graphic characters to show the lines that link subdirectories.
/?/? 在命令提示符下显示帮助。Displays help at the command prompt.

示例Examples

若要显示当前驱动器中磁盘上所有子目录的名称,请键入:To display the names of all the subdirectories on the disk in your current drive, type:

tree \

若要每次显示一个屏幕,驱动器 C 上的所有目录中的文件,请键入:To display, one screen at a time, the files in all the directories on drive C, type:

tree c:\ /f | more

若要在驱动器 C 上打印所有目录的列表,请键入:To print a list of all the directories on drive C, type:

tree c:\ /f  prn

其他参考Additional References