mac终端中显示tree的命令

寻觅了良久终于找到了mac下如何在终端显示tree的命令了,做为从linux下转过来的人,还没适应mac的finder,仍是喜欢在命令行下查看文件。linux

命令:bash

find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'

而后手动alias一下,在你的.bash_profile或者.zshrc中添加:ui

alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" 

搞定spa

http://the5fireblog.b0.upaiyun.com/staticfile/Snip20131105_23.png

要是能显示颜色和控制层级就更好了。命令行

PS:也能够经过brew install tree 安装。code