您的位置:首页 > 其它

Mac OSX下的tree命令

2017-05-23 18:27 309 查看

0.本文目录

本文目录

开篇明志

曲线救国-解决方案

1.开篇明志

想生成当前文件夹的树状结构,然而,mac下默认是没有
tree
命令

-bash: tree: command not found




2.曲线救国-解决方案

修改
~/.bash_profile
配置文件

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


通过brew命令安装tree组件

brew install 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


进入
~/software
目录下,执行
tree
命令, 生成下面树状结构:

iMac:software anthony$ tree
.
├── GitHub\ Desktop\ 222.zip
├── MacWW_7_6_10-7.08.00-8659.dmg
├── Python
│   └── Anaconda3-4.3.1-MacOSX-x86_64.sh
├── Redis
│   ├── redis-3.0.0.tar.gz
│   └── redis-desktop-manager-0.8.3-2550.dmg
├── apache-maven-3.5.0-bin.tar.gz
├── apache-tomcat-8.0.22.zip
├── cn_windows_7_professional_with_sp1_vl_build_x64_dvd_u_677816.iso
├── license.dash-license
├── mysql-5.7.13-osx10.11-x86_64.dmg
├── mysql-workbench-community-6.3.3-osx-x86_64.dmg
├── qt-opensource-mac-x64-clang-5.6.2.dmg
├── sogou_mac_32c.dmg
├── weka-3-8-0-oracle-jvm.dmg
└── xmind-8-mac-wm.dmg

2 directories, 15 files
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: