想查看當前文件夾的樹狀結構,在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
該方法我沒有試過.