- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Kill multiple users processes simultaneously
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 08:22 AM
07-24-2002 08:22 AM
Kill multiple users processes simultaneously
PS I am new to HP-UX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 08:25 AM
07-24-2002 08:25 AM
Re: Kill multiple users processes simultaneously
kill `ps -ef | grep posapp | awk '{print $2}'`
...but I hold no responsibility of harming your system due to this :-)
Cheers,
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 08:28 AM
07-24-2002 08:28 AM
Re: Kill multiple users processes simultaneously
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 08:29 AM
07-24-2002 08:29 AM
Re: Kill multiple users processes simultaneously
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 08:39 AM
07-24-2002 08:39 AM
Re: Kill multiple users processes simultaneously
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 08:47 AM
07-24-2002 08:47 AM
Re: Kill multiple users processes simultaneously
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 08:48 AM
07-24-2002 08:48 AM
Re: Kill multiple users processes simultaneously
for PID in $(ps -fudxb|tr -s " "|grep -v UID|cut -d" " -f3)
do
kill $PID
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 08:52 AM
07-24-2002 08:52 AM
Re: Kill multiple users processes simultaneously
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 11:52 AM
07-24-2002 11:52 AM
Re: Kill multiple users processes simultaneously
echo "Enter the user to dump"
read DUMPEE
CHECK=`grep ^$DUMPEE /etc/passwd|awk -F: '{print $1}'`
if [ ${CHECK}x = x ] ; then
echo "NO SUCH USER"
exit
else
#fall through
PIDLIST=/tmp/pidlist
if [ -f $PIDLIST ] ; then
rm -f $PIDLIST
fi
touch $PIDLIST
ps -ef | grep $DUMPEE|awk '{print $2}' >>$PIDLIST
for PID in `cat $PIDLIST` ; do
kill $PID
done
fi
Now, cuz i have all production machines at the site Im at, this is not tested. Dont complain if it kills your system like you think it should.
If you notice there are several key commands in the examples other than kill which you should get familiar with to fix things like this yerself in the future as well as scripting syntax given by others as well as myself. I'd recommend you get some books like "UNIX System Administration", "Unix in a Nutshell", and something on either the Korn or Borne shell published by O'Reilly and Associates
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2002 01:09 PM
07-24-2002 01:09 PM
Re: Kill multiple users processes simultaneously
Usage:
twep username
The output is a little ugly (sorry, been lazy) but it gets the job done and I've never noticed it behaving wrong.
The name comes from the old BSD manual pages -- the 9 signal was "terminate with extreme prejudice." I suppose it's not politically correct any more... :(
--Misa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2002 12:22 AM
07-25-2002 12:22 AM
Re: Kill multiple users processes simultaneously
If you are not carefull you could end up killing other processes as well - For example if you had a user called "paul" and an other user "paula" a grep for paul from ps -ef will call up paula as well. Likewise a grep for Paul will also pull up "bigpaul" if you have a user called bigpaul.
You can get around this by putting spaces around your grep ie grep " paul " or by using "^" etc but "ps -fupaul" will only pull up processes for paul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2002 06:56 AM
07-25-2002 06:56 AM
Re: Kill multiple users processes simultaneously
If so, why not take the 30 seconds from your day to assign points to people who took longer than that to answer your request for help?
If not then what is missing from the responses to help you solve your problem?
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2002 07:12 AM
07-25-2002 07:12 AM
Re: Kill multiple users processes simultaneously
kill -9 `ps -fu [username] | grep -v "PID" | awk '{print $2}'`
Hope it helps.
-Tom