brew 常用命令

1、安装软件

brew search nginx

输出:


==> Formulae
nginx ✔
2、查看安装包信息

brew info nginx

输出:

==> Formulae
nginx ✔
(base) yangzhiyong@yangzhiyongs-MacBook-Pro /var % brew info nginx
==> nginx: stable 1.25.4 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/usr/local/Cellar/nginx/1.25.4 (26 files, 2.4MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-03-18 at 11:40:54
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/n/nginx.rb
License: BSD-2-Clause
==> Dependencies
Required: openssl@3 ✔, pcre2 ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To start nginx now and restart at login:
  brew services start nginx
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/nginx/bin/nginx -g daemon\ off\;
==> Analytics
install: 14,355 (30 days), 34,325 (90 days), 179,179 (365 days)
install-on-request: 14,330 (30 days), 34,218 (90 days), 178,806 (365 days)
build-error: 4 (30 days)



3、安装

brew install nginx


4、查看安装目录

brew list nginx


输出:


/usr/local/Cellar/nginx/1.25.4/.bottle/etc/ (15 files)

/usr/local/Cellar/nginx/1.25.4/bin/nginx

/usr/local/Cellar/nginx/1.25.4/homebrew.mxcl.nginx.plist

/usr/local/Cellar/nginx/1.25.4/homebrew.nginx.service

/usr/local/Cellar/nginx/1.25.4/html -> ../../../var/www

/usr/local/Cellar/nginx/1.25.4/share/man/man8/nginx.8

/usr/local/Cellar/nginx/1.25.4/share/nginx/ (2 files)


5、卸载

brew uninstall nginx

Uninstalling /usr/local/Cellar/nginx/1.25.4... (26 files, 2.4MB)

Warning: The following nginx configuration files have not been removed!
If desired, remove them manually with `rm -rf`:
  /usr/local/etc/nginx
  /usr/local/etc/nginx/fastcgi.conf
  /usr/local/etc/nginx/fastcgi.conf.default
  /usr/local/etc/nginx/fastcgi_params
  /usr/local/etc/nginx/fastcgi_params.default
  /usr/local/etc/nginx/koi-utf
  /usr/local/etc/nginx/koi-win
  /usr/local/etc/nginx/mime.types
  /usr/local/etc/nginx/mime.types.default
  /usr/local/etc/nginx/nginx.conf
  /usr/local/etc/nginx/nginx.conf.default
  /usr/local/etc/nginx/scgi_params
  /usr/local/etc/nginx/scgi_params.default
  /usr/local/etc/nginx/servers
  /usr/local/etc/nginx/uwsgi_params
  /usr/local/etc/nginx/uwsgi_params.default
  /usr/local/etc/nginx/win-utf



标签: 、面试
  • 回复
隐藏