mac终端中显示tree的命令

作者: the5fire 标签: mac tree 发布: 2013-11-06 阅读: 17410

寻觅了良久终于找到了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'"

搞定

http://sss.the5fire.com/staticfile/Snip20131105_23.png

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

PS:也可以通过brew install tree 安装。

---- EOF ----

微信公众号:Python程序员杂谈

相关文章