Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    Does this answer your question? How to filter IPv4 and IPv6 addresses? Commented Feb 26, 2021 at 20:35
  • My post seeks alternate, perhaps better, ways of doing what the commands listed do. Namely finding all lines in a file that contain ipv4 address but excluding lines containing IP's in the class C range specified. Proposals at the link are simply for finding IP's without excluding some. Commented Feb 26, 2021 at 20:59
  • edit your question to include concise, testable sample input and expected output so we can help you. Commented Feb 26, 2021 at 21:25
  • This is a horrible hack, but a little easier. sed -i '/192.168.*/d' ./file_name.txt - which gives you the output you're already getting in a shorter format. It removes all lines that have 192.168.* in them. Commented Feb 27, 2021 at 0:29