- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: query on process id
Operating System - Linux
1753902
Members
9874
Online
108810
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО06-07-2007 11:46 PM
тАО06-07-2007 11:46 PM
query on process id
hi all,
assume tht i am running a process run.sh.My question is that how to run another script where it should get the pid of run.sh and kill it.
wht are the commands to get the pid alone of run.sh
assume tht i am running a process run.sh.My question is that how to run another script where it should get the pid of run.sh and kill it.
wht are the commands to get the pid alone of run.sh
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 11:52 PM
тАО06-07-2007 11:52 PM
Re: query on process id
Hey
#ps -ef | grep run.sh | grep -v grep | awk '{print $2}'
this returns the second field of the ps output. perhaps it's another field number.
Regards
#ps -ef | grep run.sh | grep -v grep | awk '{print $2}'
this returns the second field of the ps output. perhaps it's another field number.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2007 12:22 AM
тАО06-08-2007 12:22 AM
Re: query on process id
hi
$ UNIX95= ps -fC test.sh
and only the PID:
$ UNIX95= ps -C test.sh -o pid=
rgds
HGH
$ UNIX95= ps -fC test.sh
and only the PID:
$ UNIX95= ps -C test.sh -o pid=
rgds
HGH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2007 09:52 AM
тАО06-08-2007 09:52 AM
Re: query on process id
'pidof' is your friend:
kill -TERM `pidof run.sh`
It will return a space-separated list of PID's that match the process name you give. It usually lives as a symbolic link as '/sbin/pidof'.
kill -TERM `pidof run.sh`
It will return a space-separated list of PID's that match the process name you give. It usually lives as a symbolic link as '/sbin/pidof'.
One long-haired git at your service...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP