linux kill processes running on a pts

Richard D. Williams richard at appgrp.net
Tue Dec 12 08:28:26 PST 2017


I call this one, /usr/local/bin/kill_pts;

ps --no-headers -t $1 | sort -nr | awk '{ print $1 }' | xargs sudo 
/bin/kill -15

I use this above script in conjunction with this one.

Check users over an hour of idle time, /usr/local/bin/chkusers_overhr;

w | awk '{ print $1 "\t" $2 "\t" $5 }' | grep :[0-9][0-9]m | grep -v 
stream | grep -v root | more

The "grep -v" excludes certain users from the script.

Hope this helps someone,

Richard D. Williams







More information about the Filepro-list mailing list