Linux之进程端口(ps进程,lsof端口,关闭进程)

ps -ef|grep tomcat

ps  显示进程信息    

-ef 全格式

| 管道

grep [关键字查找关键字有关的信息

ps -ef 表示查看全格式的全部进程

ps -ef|grep tomcat  查找含tomcat的进程,并全格式显示

查看端口占用情况

查看所有端口

netstat -tunlp 

查看指定端口

netstat -tunlp|grep 8080

lsof -i:4444

查看进程

ps [进程号]

终止进程

kill -9 [进程号]

原文地址:https://www.cnblogs.com/bf-blackfish/p/13219702.html