一、生成文件夹的文件树
方法1
在cmd中输入命令:
tree + 指定路径
例如:
C:\Users\53224>tree D:\file_for_test
运行结果:
卷 新加卷 的文件夹 PATH 列表
卷序列号为 A0EE-9D09
D:\FILE_FOR_TEST
├─image
└─video
方法2
直接在指定路径下打开cmd,然后输入命令:
tree
例如:
D:\file_for_test>tree
运行结果:
卷 新加卷 的文件夹 PATH 列表
卷序列号为 A0EE-9D09
D:.
├─image
└─video
二、生成所有文件的文件树
方法1
在cmd中输入命令:
tree + 指定路径 + /f
例如:
C:\Users\53224>tree D:\file_for_test /f
运行结果:
卷 新加卷 的文件夹 PATH 列表
卷序列号为 A0EE-9D09
D:\FILE_FOR_TEST
├─image
│ bgr.png
│ fuji.jpg
│ fuji_gray.jpg
│ mountain.jpg
│ mountfuji.jpg
│ sunset.jpg
│ valley.jpg
│
└─video
bosnian.mp4
hongkong.mp4
mexico.mp4
swiss.mp4
thailand.mp4
utahmountain.mp4
westcanada.mp4
方法2
直接在指定路径下打开cmd,然后输入命令:
tree /f
例如:
D:\file_for_test>tree /f
运行结果:
卷 新加卷 的文件夹 PATH 列表
卷序列号为 A0EE-9D09
D:.
├─image
│ bgr.png
│ fuji.jpg
│ fuji_gray.jpg
│ mountain.jpg
│ mountfuji.jpg
│ sunset.jpg
│ valley.jpg
│
└─video
bosnian.mp4
hongkong.mp4
mexico.mp4
swiss.mp4
thailand.mp4
utahmountain.mp4
westcanada.mp4
三、将生成的文件树保存在txt文件中
直接在上述任何命令后面空一格,然后添加:
文件名.txt
或
文件路径\文件名.txt
例如:
D:\file_for_test>tree > file_tree.txt
D:\file_for_test>tree > D:\file_tree.txt
完。