1. 程式人生 > >如何用CMD遞迴檢視Windows中資料夾結構 也叫做樹形結構!

如何用CMD遞迴檢視Windows中資料夾結構 也叫做樹形結構!

CMD tree /? 就可以查詢用法!

程式碼如下:

C:\>tree /?
以圖形顯示驅動器或路徑的資料夾結構。

TREE [drive:][path] [/F] [/A]

   /F   顯示每個資料夾中檔案的名稱。
   /A   使用 ASCII 字元,而不使用擴充套件字元。


C:\>

在這裡插入圖片描述
/F跟/A的區別!
在這裡插入圖片描述

D:\pycodes>tree /A
卷 大寶寶 的資料夾 PATH 列表
卷序列號為 6EE8-9B4D
D:.
\---python123demo
    \---python123demo
        +---spiders
        |   \---__pycache__
        \---__pycache__

D:\pycodes>tree /F
卷 大寶寶 的資料夾 PATH 列表
卷序列號為 6EE8-9B4D
D:.
└─python123demo
    │  scrapy.cfg
    │
    └─python123demo
        │  items.py
        │  middlewares.py
        │  pipelines.py
        │  settings.py
        │  __init__.py
        │
        ├─spiders
        │  │  __init__.py
        │  │
        │  └─__pycache__
        └─__pycache__

D:\pycodes>