- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- kill by process name
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
Discussions
Discussions
Discussions
Forums
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
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
тАО02-13-2004 01:49 AM
тАО02-13-2004 01:49 AM
Does anyone have one ?
Thank you :)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 01:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 01:54 AM
тАО02-13-2004 01:54 AM
Re: kill by process name
#!/usr/bin/ksh
PROC=$1
for PID in `ps -eaf | grep -v grep | grep $PROC | awk '{ print $2}'`
do
kill $PID
done
HTH,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 01:54 AM
тАО02-13-2004 01:54 AM
Re: kill by process name
I typed it out of a text book. It is powerful and dangerous. I added protection against slamming processes owned by root.
See attachment
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 01:56 AM
тАО02-13-2004 01:56 AM
Re: kill by process name
This is, indeed, very dangerous. You need to be extremely careful with your grep command to make sure you get exactly the process you want. I would suggest display the output of the grep for confirmation before killing anything!
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 01:56 AM
тАО02-13-2004 01:56 AM
Re: kill by process name
test=`ps -ef |gerp 'process name'`
echo $test
Search in this string for the pid and kill it.
Maybe this helps.
Best regards,
Oliver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 01:58 AM
тАО02-13-2004 01:58 AM
Re: kill by process name
Regards,
Oliver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 02:10 AM
тАО02-13-2004 02:10 AM
Re: kill by process name
(In case you do come back to this).
It took a bit of searching but I found an excellent thread on this very subject. Pay particular attention to the responses of JRF and Bill H.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 02:11 AM
тАО02-13-2004 02:11 AM
Re: kill by process name
rm .killit*
echo "TRAN" $1 > .killit1
ps -ef | cut -c10-15,48-80 >> .killit1
awk '/^TRAN/{matchme=$2;next;}$2==matchme{print "kill ",$1};' .killit1 > .killit
2
chmod +x .killit2
./.killit2
Make sure on word wrap. Right now there is a "2" showing up on a seperate line which should really be the end of ".killit2".
Best regards,
Kent Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 02:11 AM
тАО02-13-2004 02:11 AM
Re: kill by process name
Sorry, it would help if I included the thread, wouldn't it?
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0xc8d7a135f587d5118ff00090279cd0f9%2C00.html&admit=716493758+1076684925468+28353475
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2004 02:13 AM
тАО02-13-2004 02:13 AM
Re: kill by process name
Pete
Pete