opposite of grep
I'm wanting to match line if it doesn't equal something...
For example ls | grep ab Would match any file that has 'ab' in it and return it. I'm wanting to exclude any file that has a particular phrase.. Thanks |
ls |grep -v ab
-v switch is what you want |
and if i wanted to exclude more than one word?
ie: top |grep -v daemon +conky +firefox (excuse my googlystuff) |
Hi,
You can use egrep for that: ls | egrep -v "daemon|conky|firefox" This will exclude daemon, conky and firefox from the ls listing. Hope this helps. |
grep -E (aka egrep) - use regex rather than googlystuff.
Code:
top -b -n 1 | grep -Ev "(daemon|conky|firefox)" |
Hi to you too syg00 ;)
|
Or do it the uneffcient way.
$ ls | grep -v "not_this" | grep -v "or_this" | grep -v "and_not_this_too" |
______________
That's really cool, thanx heaps guys |
Hi,
@CQ1ST: Glad to see that we could be of assistance :) |
All times are GMT -5. The time now is 11:03 AM. |