i ve been reading lots of example here and i didn t find a solution to my problem. i have been given a list of 1200 IP one per line, and i need to verify if we have a trace of any of these ip in a log fine. so i have file ip.txt and log.txt, witch contain also one ip per line.
thxx for your help
grep -Fx -f ip.txt log.txt
– Jetchisel Apr 03 '20 at 06:25grep -Fx -f ip.txt log.txt
nocomp@P0wnBox:/media/nocomp/2CFD-E610/ip$ any idea why? thx for your time
– nocomp Apr 03 '20 at 07:26ip.txt
andlog.txt
now if you have more to parse/do please update your question and post it. Show some sample input of both files and the desired output, and please post something what have you tried to do. – Jetchisel Apr 03 '20 at 07:29x
withw
option from grep and see if it helps. – Jetchisel Apr 03 '20 at 07:54IFS=$'\n'; for i in $(cat ip.txt); do cat log.txt | grep -q $i && echo $i; done
– moo Apr 03 '20 at 07:55grepcidr
– A.B Apr 04 '20 at 08:43