查看某端口是否被占用
$ netstat -an | grep <端口号>
如:查看当前8080端口是否被占用:
$ netstat -an | grep 8080
查看某端口被哪个程序占用
$ lsof -i:<端口号>
如:查看当前8080端口被何程序占用:
$ lsof -i:8080
根据 PID 杀死某进程
根据 PID (进程ID) 杀死指定进程,PID可在执行lsof -i:<端口号>
的COMMAND
中列出。
$ sudo kill -9 <PID>
FEATURED TAGS
algorithm
algorithmproblem
architecturalpattern
architecture
aws
c#
cachesystem
codis
compile
concurrentcontrol
database
dataformat
datastructure
debug
design
designpattern
distributedsystem
django
docker
domain
engineering
freebsd
git
golang
grafana
hackintosh
hadoop
hardware
hexo
http
hugo
ios
iot
java
javaee
javascript
kafka
kubernetes
linux
linuxcommand
linuxio
lock
macos
markdown
microservices
mysql
nas
network
networkprogramming
nginx
node.js
npm
oop
openwrt
operatingsystem
padavan
performance
programming
prometheus
protobuf
python
redis
router
security
shell
software testing
spring
sql
systemdesign
truenas
ubuntu
vmware
vpn
windows
wmware
wordpress
xml
zookeeper