Link to home
Start Free TrialLog in
Avatar of lolaferrari
lolaferrariFlag for United Kingdom of Great Britain and Northern Ireland

asked on

filter a list of processes without using grep -v

I have a list of processes running on my server pasted out into a file and I want to filter out maybe 60 processes that i have in another list. Is there a better way of doing this than using grep -v ?
ASKER CERTIFIED SOLUTION
Avatar of serialband
serialband
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lolaferrari

ASKER

I just thought there might have been a better way to filter things out than using egrep -v ('...') You see I might have as many as 40 or 50 items that I want to filter out and I just wondered if there was another way to do it.
Hi lolaferrari,

serialband has given you 3 options.  What is wrong with the 3rd one of them?  You can put your 40 or 50 (or as many as you like) items in the exclude_list.txt file (or whatever filename you what to use).
Fantastic help! thank you
Ok, strange.  I though I responded to you @tel2.  In fact, I remember doing it twice, but I still don't see my response.


It's as you say.  I gave examples to help with the syntax, since I wasn't sure what @lolaferrari needed.

@lolaferrari
The 3rd option is best with a file with 40 or 50 items.  I can't think of anything that would improve on that.  The grep command placese everything into one grep process.  Anything else would spawn additional processes and slow it down more.