APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

managing processes under linux

Got questions? Go ahead: Ask me anything!



Author: anonymous
Date: Wed Oct 12 04:47:16 2005

How do I kill all processes that are owned by the current user but that are not associated with their current login tty.

I have to run ps before killing any processes and display the output on the screen and kill the required processes then re-run ps to display the processes left after the kill action.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> managing processes under linux

1 comment



Increase ad revenue 50-250% with Ezoic


More Articles by © anonymous







Wed Oct 12 09:25:29 2005: 1184   TonyLawrence

gravatar
It depends on how you want to do this. You could use killall -i to do it interactively, or you simply write a script that picks up the "?" processes and kills them.

Something similar to

kill `ps x --deselect T -o pid`

maybe ?

Play with

for i in `ps x --deselect T -o pid` ; do ps -p $i; done

until you see what you want.





------------------------
Kerio Samepage


Have you tried Searching this site?

Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





Beware of bugs in the above code; I have only proved it correct, not tried it. (Donald Knuth)





This post tagged: