1.Fedora20系统下启动一个jetty服务器.端口8080;
2.执行命令,会显示如下:
[[email protected] bin]$ lsof -i:8080 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 10033 doctor 180u IPv6 253547 0t0 TCP *:webcache (LISTEN) [[email protected] bin]$
得到PID 10033.
3.执行命令:
[[email protected] ~]$ ps aux |grep 10033 doctor 10033 1.7 12.4 6044780 979184 pts/1 Sl 11:07 0:34 /home/doctor/opt/jdk1.8.0_25/bin/java -Djetty.home=/home/doctor/opt/jetty9-jenkins -Djetty.base=/home/doctor/opt/jetty9-jenkins -Djava.io.tmpdir=/tmp -jar /home/doctor/opt/jetty9-jenkins/start.jar jetty-started.xml doctor 10874 0.0 0.0 112696 2300 pts/1 S+ 11:41 0:00 grep --color=auto 10033 [[email protected] ~]$
或者
[[email protected] ~]$ ps u 10033 |cat USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND doctor 10033 1.5 12.4 6044780 979184 pts/1 Sl 11:07 0:34 /home/doctor/opt/jdk1.8.0_25/bin/java -Djetty.home=/home/doctor/opt/jetty9-jenkins -Djetty.base=/home/doctor/opt/jetty9-jenkins -Djava.io.tmpdir=/tmp -jar /home/doctor/opt/jetty9-jenkins/start.jar jetty-started.xml [[email protected] ~]$
后面的cat显示主要是为了换行,这样信息显示的全.
时间: 2024-09-28 08:09:20