
背景:在多进程时,用那个叫物理内存、虚拟内存的,怎么看?
To see every process with a user-defined format:
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
Print only the process IDs of syslogd:
ps -C syslogd -o pid=
相查看树,能看到进程的继承关系:
ps -eo 'pid,ppid,vsz,rss,cmd' --forest
3078 1214 48620 3032 \_ sshd: xiangdong [priv]
3084 3078 48752 1680 \_ sshd: xiangdong@pts/0,pts/1,pts/2
3085 3084 108352 1788 \_ -bash
3644 3085 189592 2940 | \_ sudo su -
3645 3644 163756 1964 | \_ su -
3646 3645 108476 1908 | \_ -bash
5416 3646 108412 1200 | \_ ps -eo pid,ppid,vsz,rss,cmd --forest
5417 3646 105460 816 | \_ less
1481 1 55604 1460 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
1484 1481 76816 22864 \_ nginx: worker process
1485 1481 76816 22936 \_ nginx: worker process
1486 1481 76816 22936 \_ nginx: worker process
1487 1481 76816 22936 \_ nginx: worker process
To see every process with a user-defined format:
ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
Print only the process IDs of syslogd:
ps -C syslogd -o pid=
相查看树,能看到进程的继承关系:
ps -eo 'pid,ppid,vsz,rss,cmd' --forest
3078 1214 48620 3032 \_ sshd: xiangdong [priv]
3084 3078 48752 1680 \_ sshd: xiangdong@pts/0,pts/1,pts/2
3085 3084 108352 1788 \_ -bash
3644 3085 189592 2940 | \_ sudo su -
3645 3644 163756 1964 | \_ su -
3646 3645 108476 1908 | \_ -bash
5416 3646 108412 1200 | \_ ps -eo pid,ppid,vsz,rss,cmd --forest
5417 3646 105460 816 | \_ less
1481 1 55604 1460 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
1484 1481 76816 22864 \_ nginx: worker process
1485 1481 76816 22936 \_ nginx: worker process
1486 1481 76816 22936 \_ nginx: worker process
1487 1481 76816 22936 \_ nginx: worker process
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/9908/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2018-10-1 14:15
评论列表