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