一、安装brew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
 
按回车后,根据提示操作:输入镜像序号 --> 输入Y,回车等待brew安装完成即可。
在终端输入brew -v后,会提示你执行两个配置命令,直接复制执行就ok了!
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core
 
二、安装Nginx
brew install
 
Nginx的服务器默认路径:/opt/homebrew/var/www
配置文件路径:/opt/homebrew/etc/nginx/nginx.conf
安装路径:/opt/homebrew/opt/nginx
开启nginx:sudo nginx
关闭nginx:sudo nginx -s stop
重新加载:sudo nginx -s reload
三、注意
1、是否启动成功
在终端中输入
ps -ef|grep nginx
 
如果执行结果是
表示已启动成功
2、停止
关闭nginx:sudo nginx -s stop
如果上面这个不管用
在终端中输入 ps -ef|grep nginx 获取到nginx的进程号,注意是找到“nginx:master”的那个进程号。
 
kill -QUIT 26781 (从容的停止,即不会立刻停止)
Kill -TERM 26781 (立刻停止)
Kill -INT 26781 (和上面一样,也是立刻停止)
 
3、重启
重新加载:sudo nginx -s reload
如果上面这个不管用,就用第2步的先杀死进程之后再启动。
四、卸载brew和常用命令
二、brew 卸载脚本
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"
 
三、常用命令
安装软件:brew install xxx
 卸载软件:brew uninstall xxx
 搜索软件:brew search xxx
 更新软件:brew upgrade xxx
 查看列表:brew list
 更新brew:brew update
 清理所有包的旧版本:brew cleanup
 清理指定包的旧版本:brew cleanup $FORMULA
 查看可清理的旧版本包,不执行实际操作:brew cleanup -n
- MacOS下卸载nodejs:https://pythonjishu.com/rktpzdtbkn/
 














![[C++]string的使用](https://img-blog.csdnimg.cn/b71b46e263304e0798db79e48fbdea2d.png)
![[Dubbo] 重要接口与类 (三)](https://img-blog.csdnimg.cn/213f81e69c444b35923d9a61d6f68c9b.png)



