Homebrew包管理器
Homebrew包管理器可以在Linux和Windows子系統Linux(WSL)上使用。在Linux或WSL上運作時,Homebrew以前被稱為Linuxbrew。它可以安裝在您的主目錄中,在這種情況下它不使用sudo。Homebrew不使用主機系統提供的任何庫,除非glibc和gcc足夠新。Homebrew可以為舊的Linux發行版安裝自己目前版本的glibc和gcc。
https://docs.brew.sh/Homebrew-on-Linux
配置完成 bash
要使Homebrew的完成可用bash,您必須将定義作為shell啟動的一部分來源。将以下内容添加到您的~/.bash_profile檔案中:
if type brew &>/dev/null; then
for COMPLETION in $(brew --prefix)/etc/bash_completion.d/*
do
[[ -f $COMPLETION ]] && source "$COMPLETION"
done
if [[ -f $(brew --prefix)/etc/profile.d/bash_completion.sh ]];
then
source "$(brew --prefix)/etc/profile.d/bash_completion.sh"
fi
fi
常用指令:
檢視版本資訊:
brew --version
檢視所有安裝包:
brew --list:
檢視下載下傳路徑:
brew --cache[ formula]
檢視安裝路徑:
brew --cellar[ formula]
顯示Homebrew的安裝路徑。預設值: /usr/local在macOS和 /home/linuxbrew/.linuxbrewLinux上。
brew --prefix[ formula]
參考連接配接
https://docs.brew.sh/Shell-Completion