1.查看进程:ps -ef 或ps -aux得到进程的pid:如:ps -ef | grep process_name | grep -v "grep" | awk ‘{print $2}‘2.根据进程号进行查询:# pstree -p 进程号# top -Hp 进程号3.根据进程名字进行查询:#pstree...
1. 查看进程:ps -ef 或ps -aux
得到进程的pid:
如:ps -ef | grep process_name | grep -v "grep" | awk ‘{print $2}‘
2.根据进程号进行查询:
# pstree -p 进程号
# top -Hp 进程号
3.根据进程名字进行查询:
#pstree -p `ps -e | grep server | awk ‘{print $1}‘`
#pstree -p `ps -e | grep server | awk ‘{print $1}‘` | wc -l
4.查看线程数
需要得到线程的PID
查看进程的所有线程
#ps mp 6648 -o THREAD,tid
USER%CPU PRI SCNT WCHAN USER SYSTEM TID
root0.0 - - - - - -root0.0 24 - - - - 6648root0.0 21 - - - - 6650root1.0 24 - - - - 14214root0.0 23 - futex_ - - 14216root0.0 22 - 184466 - - 15374root0.0 23 - 184466 - - 15376root0.0 23 - 184466 - - 15378root0.0 23 - 184466 - - 15380root0.0 23 - 184466 - - 15392root0.0 23 - 184466 - - 15394root0.0 23 - 184466 - - 15398查看所有子进程:
# pstree-p 6648agent_executor(6648)tar(15601)gzip(15607)
{agent_executor}(6650)
{agent_executo