Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to kill all user processes at once?

Status
Not open for further replies.

larsin

MIS
Mar 18, 2003
16
0
0
US
Instead of doing ps -ef grep username to list all previous processes, I want to kill all old user processes at the same time.

We lost our T-1 connection, so it's still showing all old processes.

Thanks

Larsin
 
This will depend on your OS. Different flavours of unix have different tools for killing idle users.
 
You need to check which field the process ID is in from that ps command, but something like
[tt]
ps -ef grep username | awk '{ system( "kill -9 " $2 ) }'
[/tt]


--
 
The following command kills all processes owned by the user 'username'
[tt]
ps -u username -o pid= | xargs kill -9
[/tt]

Jean Pierre.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top