1. 程式人生 > >linux 查看線程和線程數

linux 查看線程和線程數

進程信息 nginx 使用 oot ets sta rep linu CM

linux下查看線程方法
一、ps

[root@iZtd8ajr022 ~]# ps -T -p 30557
  PID  SPID TTY          TIME CMD
30557 30557 ?        00:00:00 nginx

二、top

top -H -p <pid>

附:
查看tomcat進程號:ps -ef | grep tomcat
根據進程號查詢對應的目錄:/proc/pid/cwd、ls -la /proc/pid/fd
根據目錄查找對應的進程:lsof /usr/local/nginx/
查看tomcat的線程數:ps -Lf pid|wc -l
lsof -Pnl +m -i4|grep 端口號 #根據此命令查出端口號對應的進程pid,然後使用ps查到進程信息。

netstat -antulp|grep 端口號 #根據此命令查出端口號對應的進程pid,然後使用ps查到進程信息。

linux 查看線程和線程數