I’ll just show you one more way to do that I found. It’s quite flexible:
Using the command ps
same. But passing options to the command. This is the call signature:
ps o <campos a ser exibido>
Examples:
Simple call:
[root@alab ~]# ps
PID TTY TIME CMD
1946 pts/0 00:00:00 bash
1966 pts/0 00:00:00 ps
Call with the PGID:
[root@alab ~]# ps o pgid
PGID
1463
1465
1467
1469
1475
1582
1946
1970
Notice that when we pass the o
We must tell you exactly what columns we want to display. So to get something more complete and add the PGID we can use the command as follows:
Most complete call:
[root@alab ~]# ps axo pid,pgid,tty,time,comm
PID PGID TT TIME COMMAND
1 1 ? 00:00:00 init
2 0 ? 00:00:00 kthreadd
[...cut...]
1463 1463 tty2 00:00:00 mingetty
1465 1465 tty3 00:00:00 mingetty
1467 1467 tty4 00:00:00 mingetty
1469 1469 tty5 00:00:00 mingetty
1473 470 ? 00:00:00 udevd
1474 470 ? 00:00:00 udevd
1475 1475 tty6 00:00:00 mingetty
1493 1493 ? 00:00:00 auditd
1516 1159 ? 00:00:00 console-kit-dae
1582 1582 tty1 00:00:00 bash
1894 1894 ? 00:00:00 dhclient
1942 1942 ? 00:00:00 sshd
1946 1946 pts/0 00:00:00 bash
1975 1975 pts/0 00:00:00 ps
It is also possible to kill the process using the
PID
. Why specifically use thePGID
? It is to kill all processes of a group of users?– Yamaneko
My question started here: http://answall.com/questions/3522/comolidar-com-um-processo-comet/
– alacerda