命令
netstat -nl | grep 5432
netstat -nat | grep 5432
lsof如果看不到netstat显示的端口的进程。前面加sudo就能看到了。
sudo lsof -i :5432
查看文件
stat foo
# 另一种查看时间方式
mdls foo
sudo spctl --master-disable
Homebrew
国内源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
执行生效
# 更新Homebrew本身
brew update
安装卸载
brew install
brew uninstall
更新
# 更新所有
brew upgrade
# 更新指定
brew upgrade foo
# 查看哪些可以更新
brew outdated
清理
brew cleanup
brew cleanup foo
brew cleanup -n
锁住不想更新的包,brew update
会忽略它
brew pin foo
brew unpin foo
brew info foo
brew info