Regex, but without

Michael Hipp Michael at Hipp.com
Tue Jan 29 06:37:26 PST 2008


I'm not a very deep expert on regular expressions, and I can't seem to 
find the answer in my trusty copy of 'Mastering Regular Expressions'.

I want to find all instances of 'python' running for a given user so I 
do this:

$ ps -f -U michael | grep python
michael  24638 24618  0 08:31 pts/0    00:00:00 python
michael  24665 24643  0 08:32 pts/1    00:00:00 grep python

But I get that hanger-on in my grep command. I can easily get rid of 
that second line by stringing another grep after it, but there ought to 
be a way to do it with only one regex.

So I need a regex that will find every line with 'python' on it but not 
'grep'.

Any help?

Michael



More information about the Linux-users mailing list