LEts say you have to manually look through a bunch of log files to do a check on something. To make the job easier, you can clean up those logs from the lines you know you don't need, significantly reducing the amount of stuff you have to go through.
sed -i '#192.168.1.1#d' /tmp/*.log
Here we're using sed
to go though each of the files that match the /tmp/*.log
pattern.
-i
means we edit the files in-place#
is the delimiter so that we don't have to escape the dots in the IP address; if you're using/
as the delimiter (a common approach) then you'd have to escape the dots as\.
d
means delete the lines that have a match