文章目录
- 问题描述
- 解决办法A
- 备选办法B
- Ref
问题描述
在Git Bash中使用tree
报错:
tree
# bash: tree: command not found
解决办法A
-
下载二进制文件:
https://gnuwin32.sourceforge.net/packages/tree.htm -> 选binary。下载后解压.zip
-
把解压后的
tree.exe
移到/usr/bin
目录下# 如果Git Bash中装过sudo,直接进入tree.exe所在,执行: sudo cp tree.exe /usr/bin
完成✅,敲tree
可直接使用。Linux的tree
有的各种options都支持
备选办法B
用Windows自带的tree
工具。功能不多,凑合用用:
tree.com # 仅显示文件夹dirs
tree.com //f # 显示文件夹和文件(dirs + files)
Ref
- https://superuser.com/questions/531592/how-to-add-the-tree-command-to-git-bash-in-windows