Windows中的Tree命令 win 查看及导出目录结构

win 查看及导出目录结构

 

一、查看目录结构

目录窗口视图

1. 查看目录结构(文件夹)

在当前要操作的文件夹目录下输入命令tree. 此时得到目录下树形的目录结构。默认情况下只显示“文件夹”而不显示文件。

2. 查看目录结构(包括文件)

在tree命令后面加入参数 /f 将以层次的结构显示所有文件夹及文件的名称。

二、导出目录结构

将当前文件夹树形结构写入xxx.txt中

tree /f >darknet.txt
保存的树形结构,只含有文件夹
tree /f >darknetf.txt
保存的树形结构,包含文件夹和文件

windows下通过cmd命令符窗口查看文件目录结构
win 导出目录结构到文件

 

Windows中的Tree命令你会用吗? - 步行者的专栏 - CSDN博客 https://blog.csdn.net/hantiannan/article/details/7663893

 

(venv1) D:\pyCGlang\cd1>tree
文件夹 PATH 列表
卷序列号为 0000-D760
D:.
├─.idea
├─commons
│  └─__pycache__
├─sdk0
│  └─__pycache__
└─visit

(venv1) D:\pyCGlang\cd1>tree /F
文件夹 PATH 列表
卷序列号为 0000-D760
D:.
│  t__import__.py
│  ycan.py
│
├─.idea
│      cd1.iml
│      misc.xml
│      modules.xml
│      workspace.xml
│
├─commons
│  │  __init__.py
│  │
│  └─__pycache__
│          __init__.cpython-37.pyc
│
├─sdk0
│  │  a.py
│  │  __init__.py
│  │
│  └─__pycache__
│          a.cpython-37.pyc
│          __init__.cpython-37.pyc
│
└─visit
        __init__.py


(venv1) D:\pyCGlang\cd1>tree /A
文件夹 PATH 列表
卷序列号为 0000-D760
D:.
+---.idea
+---commons
|   \---__pycache__
+---sdk0
|   \---__pycache__
\---visit

(venv1) D:\pyCGlang\cd1>tree
文件夹 PATH 列表
卷序列号为 0000-D760
D:.
├─.idea
├─commons
│  └─__pycache__
├─sdk0
│  └─__pycache__
└─visit

(venv1) D:\pyCGlang\cd1>

  

其实tree命令 是一个很不错的功能。可以把指定文件夹的所以文件用树状罗列出来。然后我们查看树状结构就能够了解有那些文件,然后我们在去查看需要关心的有那些文件就可以了。

用法:TREE [d:][path] [/A][/F]

/A - Specifies that alternative characters (plus signs, hyphens, and vertical bars) be used to draw the tree diagram so that it can be printed by printers that don`t support the line-drawing and box-drawing characters (DOS Versions 4 and 5).

/F - Displays the names of the files found within each directory listed.

 

posted @ 2018-04-10 16:24  papering  阅读(1124)  评论(0编辑  收藏  举报