cat/delete per line any word "192.168.1.12"

Hi All

Can u help me..
My problem is delete word per line

sample:

cat /tmp/file.txt

monitor 192.168.1.11 Copying files in current directory 1
monitor 192.168.1.1 Copying files in current directory 2
monitor 192.168.1.12 Copying files in current directory 3
monitor 192.168.1.14 Copying files in current directory 4
monitor 192.168.1.15 Copying files in current directory 5
monitor 192.168.1.12 Copying files in current directory 6
monitor 192.168.1.166 Copying files in current directory 7
monitor 192.168.1.12 Copying files in current directory 8
monitor 192.168.1.112 Copying files in current directory 9

so what is command for cat/delete per line any word "192.168.1.12" in file /tmp/file.txt

Thx.
car

Hi! A simple grep command might help you, but it's not an inplace deletion.

 grep -v "192.168.1.12" /tmp/file.txt > result.txt 

If you want an inplace deletion you can do it with sed.

 sed -i '/192.168.1.12/d' /tmp/file.txt