1.通过:ps -efL | grep 进程ID或名字
UID PID PPID LWP C NLWP STIME TTY TIME CMD
user 228298 201990 228298 0 2 00:14 pts/0 00:00:00 ./t_thread
user 228298 201990 228299 0 2 00:14 pts/0 00:00:00 ./t_thread
user 228298 201990 228302 0 2 00:14 pts/0 00:00:00 ./t_thread
其中主要几列的信息为:
UID:启动进程的用户
PID:进程ID
PPID:父进程ID
LWP:线程ID
NLWP:改进程的线程总数
2.通过:pstree -p 进程ID
pstree -p 1671
gnome-session-b(1671)─┬─at-spi-bus-laun(1713)─┬─dbus-daemon(1736)
│ ├─{at-spi-bus-laun}(1719)
│ ├─{at-spi-bus-laun}(1721)