寻觅了良久终于找到了mac下如何在终端显示tree的命令了,作为从linux下转过来的人,还没适应mac的finder,还是喜欢在命令行下查看文件。
命令:
find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
然后手动alias一下,在你的.bash_profile或者.zshrc中添加:
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
搞定

要是能显示颜色和控制层级就更好了。
PS:也可以通过brew install tree 安装。
- from the5fire.com
----EOF-----
微信公众号:Python程序员杂谈
微信公众号:Python程序员杂谈