Mac OSX下的tree命令


想查看当前文件夹的树状结构,在Linux里可以通过tree命令; 但是MAC下默认是没有 tree 命令!

下面介绍两种解决方法:

1、修改 ~/.bash_profile 配置文件

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

 

Mac系统: commond+shift+G -> 输入~/.bash_profile进入.bash_profile文件夹,加入上述代码:

2、通过brew命令安装tree组件 

iMac:springredis anthony$ brew install tree Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (caskroom/cask). ==> Downloading https://homebrew.bintray.com/bottles/tree-1.7.0.sierra.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring tree-1.7.0.sierra.bottle.1.tar.gz /usr/local/Cellar/tree/1.7.0: 7 files, 113.3KB

该方法我没有试过.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM