Hi,
I got a log file and I want to grep out a list of unwanted line which are IP's.
Basiclly I want everything ecxept the ip's from my list.
If I do a
while read line
do
grep -v $ip_from_my_list logfile
done <ip_list
it just grep's one IP at a time and repeats.
Thanks for any help.
grep -v -f ip_list logfile
What you are looking for is the "-f <file>" option of grep. Have a careful look into the neverending tome of Unix knowledge (for mere mortals: issue "man grep") and investigate how you could provide grep with a list of patterns from a file.
I hope this helps.
bakunin
Thanks worked never used -f before