在Windows的Git Bash下使用tree命令


抛砖

在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
发布了28 篇原创文章 · 获赞 53 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_32682301/article/details/105179661