抛砖
在git bash里面输入命令:tree; 弹出错误如下,解决Git Bash下安装使用tree(在windows)
$ tree
bash: tree: command not found
环境
- Microsoft Windows 10 专业版 (64位)
- git version 2.24.0.windows.2
下载
官网下载:Tree for Windows
csdn下载:tree.exe
操作
将下载的tree.exe文件复制到git Bash 的安装目录下你的安装路径\Git\usr\bin
下
这样 git bash 本身就支持 tree 命令了
忽略指定文件夹
tree -I "node_modules"
忽略多个文件夹
tree -I "node_modules|cache|test_*"
只看指定层级的目录
例如两级
tree -L 2
PS:通过以下可以实现使用windows自带的tree命令
winpty tree.com