windows命令行 查看文件树结构

本文介绍如何在Windows命令行中使用tree命令来打印指定目录的文件树状结构图,详细展示了tree命令的各种参数及其使用方法,并通过实例演示了如何打印一个新建Android项目的完整文件结构。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

tree命令

在windows的命令行中使用tree命令即可打印该指定目录的文件树状结构图。

PS E:\work> tree /?
以图形显示驱动器或路径的文件夹结构。

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

   /F   显示每个文件夹中文件的名称。
   /A   使用 ASCII 字符,而不使用扩展字符。

将打印的目录树保存到指定文件中:

tree /F > 目录结构图.txt

打印目录树:

tree /F 

实例:
打印新建Android项目的文件树结构:

PS C:\Users\Makesky\Desktop\MyApplication> tree /F
卷 Windows 的文件夹 PATH 列表
卷序列号为 CC04-B3FA
C:.
│  .gitignore
│  build.gradle
│  gradle.properties
│  gradlew
│  gradlew.bat
│  local.properties
│  MyApplication.iml
│  settings.gradle
│
├─.gradle
│  └─3.3
│      └─taskArtifacts
├─.idea
│  │  compiler.xml
│  │  gradle.xml
│  │  misc.xml
│  │  modules.xml
│  │  runConfigurations.xml
│  │  workspace.xml
│  │
│  ├─copyright
│  │      profiles_settings.xml
│  │
│  └─libraries
│          constraint_layout_1_0_2.xml
│          constraint_layout_solver_1_0_2.xml
│          espresso_core_2_2_2.xml
│          espresso_idling_resource_2_2_2.xml
│          exposed_instrumentation_api_publish_0_5.xml
│          hamcrest_core_1_3.xml
│          hamcrest_integration_1_3.xml
│          hamcrest_library_1_3.xml
│          javawriter_2_1_1.xml
│          javax_annotation_api_1_2.xml
│          javax_inject_1.xml
│          jsr305_2_0_1.xml
│          junit_4_12.xml
│          rules_0_5.xml
│          runner_0_5.xml
│
├─app
│  │  .gitignore
│  │  app.iml
│  │  build.gradle
│  │  proguard-rules.pro
│  │
│  ├─build
│  │  └─intermediates
│  │      └─incremental
│  │          ├─packageDebug
│  │          │  └─zip-cache
│  │          ├─packageDebugAndroidTest
│  │          │  └─zip-cache
│  │          └─packageRelease
│  │              └─zip-cache
│  ├─libs
│  └─src
│      ├─androidTest
│      │  └─java
│      │      └─com
│      │          └─makesky
│      │              └─myapplication
│      │                      ExampleInstrumentedTest.java
│      │
│      ├─main
│      │  │  AndroidManifest.xml
│      │  │
│      │  ├─java
│      │  │  └─com
│      │  │      └─makesky
│      │  │          └─myapplication
│      │  │                  MainActivity.java
│      │  │
│      │  └─res
│      │      ├─drawable
│      │      ├─layout
│      │      │      activity_main.xml
│      │      │
│      │      ├─mipmap-hdpi
│      │      │      ic_launcher.png
│      │      │      ic_launcher_round.png
│      │      │
│      │      ├─mipmap-mdpi
│      │      │      ic_launcher.png
│      │      │      ic_launcher_round.png
│      │      │
│      │      ├─mipmap-xhdpi
│      │      │      ic_launcher.png
│      │      │      ic_launcher_round.png
│      │      │
│      │      ├─mipmap-xxhdpi
│      │      │      ic_launcher.png
│      │      │      ic_launcher_round.png
│      │      │
│      │      ├─mipmap-xxxhdpi
│      │      │      ic_launcher.png
│      │      │      ic_launcher_round.png
│      │      │
│      │      └─values
│      │              colors.xml
│      │              strings.xml
│      │              styles.xml
│      │
│      └─test
│          └─java
│              └─com
│                  └─makesky
│                      └─myapplication
│                              ExampleUnitTest.java
│
├─build
│  └─android-profile
│          profile-2018-09-14-08-31-32-071.rawproto
│
└─gradle
    └─wrapper
            gradle-wrapper.jar
            gradle-wrapper.properties
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值