On 20 Jan 12:15, Srdjan Todorovic wrote:
Hi,
2009/1/20 Steve Fosdick lists@pelvoux.nildram.co.uk:
Apart from the SAK Magic SysRq sequence does anyone know of a way to kill all the processes that have a particular virtual console open?
Some combination of lsof, grep, awk, and kill ?
How about...
brettp@miranda:~$ ps -t pts/3 --format 'pid' --no-headers 2243 22355 brettp@miranda:~$ ps -t pts/3 PID TTY TIME CMD 2243 pts/3 00:00:00 bash 22355 pts/3 00:00:04 w3m brettp@miranda:~$
Where pts/3 is the owning terminal in this case...
so you could do: ps -t pts/3 --format 'pid' --no-headers | xargs kill
Cheers,