- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- why does this work: grep [p]md?
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
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
тАО08-06-2002 06:58 AM
тАО08-06-2002 06:58 AM
ps -ef | grep pmd might return
pmd
ovspmd
and grep pmd
but ps -ef | grep [p]md returns only
pmd
ovspmd
For the life of me I can't figure out why this works? Please enlighten me! Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2002 07:20 AM
тАО08-06-2002 07:20 AM
Re: why does this work: grep [p]md?
Sometimes grep will show up, other times it won't. I believe it will depend upon the speed of "ps -ef" to the pipe. On my slower systems grep show's up.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2002 07:21 AM
тАО08-06-2002 07:21 AM
Solution# ps -ef|grep [p]md
one of the process list will be ..
root
So running "ps -ef|grep [p]md" which specifically grep for the strings "pmd" will not return "grep pmd" string because in the process list it's "grep [p]md".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2002 07:28 AM
тАО08-06-2002 07:28 AM
Re: why does this work: grep [p]md?
I would agree with Harry, because when I tried this in my old systems (which is slow), grep show's up the result. But some case it is not. I think it really the speed at which the grep can run at the specific time.
hth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2002 10:14 AM
тАО08-06-2002 10:14 AM
Re: why does this work: grep [p]md?
S.K. Chan is absolutely right!
- ps -ef | grep xxx : sometimes also lists the grep command, somtimes not; as said before probably depends on speed.
- ps -ef | grep [x]xx : cannot list the grep command itself because the command "ps -ef | grep [x]xx" will not be found by the regular expression [x]xx, as S.K. Chan mentioned.
BTW "ps -ef | grep [x]xx" is an old trick as a short replacement for "ps -ef | grep xxx | grep -v grep"
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-07-2002 03:54 AM
тАО08-07-2002 03:54 AM
Re: why does this work: grep [p]md?
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x441436e69499d611abdb0090277a778c,00.html
Jean-Luc