macos - MACOS查看端口占用情况及杀死进程
查询指定端口的进程ID
1
sudo lsof -i :9000
根据ID杀进程
1
sudo kill -9 716
改hosts
1
2
sudo vi /private/etc/hosts
:wq!
开机启动项
/System/Library/StartupItems /Library/StartupItems
显示隐藏文件
1
2
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
隐藏隐藏文件
1
2
defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder