安装tree命令 首先需要安装下载工具brew 这个类似于Linux系统的yum 安装命令如下
ruby -e "$(curl --insecure -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果提示安装失败 执行下边的命令卸载掉 重新安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
安装好之后 可以查看版本
sun@admindeMacBook-Pro final % brew --version
Homebrew 2.4.12
Homebrew/homebrew-core (git revision b3a2ff; last commit 2020-08-21)
安装Linux命令
sun@admindeMacBook-Pro final % brew install tree
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/tree-1.8.0.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Pouring tree-1.8.0.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/tree/1.8.0: 8 files, 121.1KB
使用命令
sun@admindeMacBook-Pro final % tree .
.
├── pg_all.pdf
└── required_files
├── CControllerLatest.php
├── CHistoryManager.php
├── automas_01.sh
├── automas_02.sh
├── automas_03.sh
├── create.sql
├── del_part.sh
├── partition.sh
├── pg01_check.sh
├── pg01_keepalived.conf
├── pg02_check.sh
├── pg02_keepalived.conf
├── postgresql-12.3.tar.gz
├── zabbix-5.0.2.bundle.tar
├── zabbix01_check.sh
├── zabbix01_keepalived.conf
├── zabbix02_check.sh
└── zabbix02_keepalived.conf
1 directory, 19 files