在Linux和Windows系统中输出目录结构

在Linux和Windows系统中输出目录结构

一直以来就想在写文章时,能以文本形式(而不是截图)附上项目的目录结构,今天终于知道怎么操作了,在这分享一下。

Linux

首先说下Linux上输出目录结构的方法。

yum安装tree

需要支持tree命令,首先是要安装tree包的。

1
yum -y install tree

然后在你的项目目录下执行tree命令即可

linux目录结构

还可以输出带颜色的结构

1
tree -C

带颜色的

Windows

不需要特意安装什么,直接输入命令:

1
tree /f

windows tree命令

更多参数请参考Windows Commands / tree


扫一扫下方小程序码或搜索Tusi博客,即刻阅读最新文章!

Tusi博客

You forgot to set the qrcode for Alipay. Please set it in _config.yml.
You forgot to set the qrcode for Wechat. Please set it in _config.yml.
You forgot to set the business and currency_code for Paypal. Please set it in _config.yml.
You forgot to set the url Patreon. Please set it in _config.yml.
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×