I want to make a script that lifts a PIDs for rtorrent processes, so far I got this:
netstat -tanpu | grep "rtorrent"
gives me a nice list of 7 columns, the PIDs are buried at the end of the 4th column,
tcp 0 0 213.321.40.162:6942 22.214.171.124:62649 ESTABLISHED 28387/rtorrent
I want to lift off the PID 6942 for instance, and then tell system to kill that process, but sed makes my head hurt.
How might you do it?