![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep exclude/find single and double quotes | Lindy_so | UNIX for Dummies Questions & Answers | 4 | 03-06-2008 09:01 AM |
| grep command help | geekeezoid | UNIX for Dummies Questions & Answers | 15 | 04-16-2007 11:55 PM |
| grep command | mahabunta | Shell Programming and Scripting | 2 | 09-13-2006 03:11 AM |
| grep - to exclude lines beginning with pattern | frustrated1 | Shell Programming and Scripting | 2 | 08-29-2005 07:18 AM |
| grep command ~ Need help | april04 | Shell Programming and Scripting | 6 | 10-23-2002 03:57 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how to exclude the GREP command from GREP
I am doing "ps -f" to see my process.
but I get lines that one of it represents the ps command itself. I want to grep it out using -v flag, but than I get another process that belongs to the GREP itself : I would like to exclude [root@localhost ~]# ps -f UID PID PPID C STIME TTY TIME CMD root 15794 15792 0 13:48 pts/2 00:00:00 -bash root 16157 15794 0 14:01 pts/2 00:00:00 ps -f [root@localhost ~]# ps -f | grep -v ps UID PID PPID C STIME TTY TIME CMD root 15794 15792 0 13:48 pts/2 00:00:00 -bash root 16160 15794 0 14:02 pts/2 00:00:00 -bash while all I want is to get my pid line only. or maybe you know another command that returns my pid and ppid only ? thanks |
|
|||||
|
how 'bout
Code:
echo "myPID->[$$] PPID->[$PPID]" Code:
echo "myPID->[$$] PPID->[`ps -o ppid= -p $$`]" Last edited by vgersh99; 10-04-2007 at 05:19 PM.. |
|
||||
|
Quote:
Code:
[root@dns ~]# uname -a Linux dns 2.6.22.5-76.fc7 #1 SMP Thu Aug 30 13:47:21 EDT 2007 i686 athlon i386 GNU/Linux [root@dns ~]# ps -f | grep -v ps UID PID PPID C STIME TTY TIME CMD root 2593 2572 0 Oct04 pts/1 00:00:00 -bash can you check this out: [root@dns ~]# ps -f | grep -v ps |grep -v grep UID PID PPID C STIME TTY TIME CMD root 2593 2572 0 Oct04 pts/1 00:00:00 -bash |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|