Mac 必備工具之 brew

brew 是 Mac 下的一個包管理工具,相似於 centos 下的 yum,能夠很方便地進行安裝/卸載/更新各類軟件包,例如:nodejs, elasticsearch, kibana, mysql, mongodb 等等,能夠用來快速搭建各類本地環境,程序員必備工具node

安裝 brew

首先要經過以下命令安裝 brewmysql

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

基本用法

安裝/卸載/更新

以 nodejs 爲例,執行下面命令便可,安裝目錄在 /usr/local/Cellarlinux

brew install nodejs

若是須要更新或卸載git

brew upgrade nodejs
brew remove nodejs

其餘命令

brew list                   # 列出當前安裝的軟件
brew search nodejs          # 查詢與 nodejs 相關的可用軟件
brew info nodejs            # 查詢 nodejs 的安裝信息

若是須要指定版本,能夠在 brew search 查看有沒有須要的版本,在 @ 後面指定版本號,例如 brew install thrift@0.9程序員

brew services

brew services 是一個很是強大的工具,能夠用來管理各類服務的啓停,有點像 linux 裏面的 services,很是方便,以 elasticsearch 爲例github

brew install elasticsearch          # 安裝 elasticsearch
brew services start elasticsearch   # 啓動 elasticsearch
brew services stop elasticsearch    # 中止 elasticsearch
brew services restart elasticsearch # 重啓 elasticsearch
brew services list                  # 列出當前的狀態

brew services 服務相關配置以及日誌路徑sql

  • 配置路徑:/usr/local/etc/
  • 日誌路徑:/usr/local/var/log

參考連接

轉載請註明出處
本文連接: http://hatlonely.github.io/20...
相關文章
相關標籤/搜索