Giter Site home page Giter Site logo

cidrcomm's Introduction

Name: cidrcomm

  • Similiar to Linux 'comm' command. Supports -1, -2, -12
    • -1: Suppress file1 unique entries
    • -2: Suppress file2 unique entries
    • -12: Suppress file1 unique entries and file2 unique entries, i.e. show common entries
  • Each line of input file is an IP, CIDR expression, or IP range (a.b.c.N, a.b.c.M where N and M is the range).
    • Examples
      • IP: 1.2.3.4
      • CIDR: 1.2.3.0/24
      • IP range: 1.2.3.4-1.2.3.8

Examples

// in1.txt
1.2.3.1-1.2.3.7
2.2.3.1-2.2.3.7
3.2.3.0/24
4.2.3.0/24

// in2.txt
1.2.3.4-1.2.3.8
2.2.3.4-2.2.3.8
3.2.3.2-3.2.3.254
4.2.3.3-4.2.3.253

// Find IPs or IP ranges that are found from file2 only
% python app.py -1 in1.txt in2.txt
1.2.3.8
2.2.3.8

// Find IPs or IP ranges that are found from file1 only
% python app.py -2 in1.txt in2.txt
1.2.3.1-1.2.3.3
2.2.3.1-2.2.3.3
3.2.3.1
3.2.3.255
4.2.3.1-4.2.3.2
4.2.3.254-4.2.3.255

// Find IPs or IP ranges that are found from both files, i.e., show common entries.
% python app.py -12 in1.txt in2.txt
1.2.3.4-1.2.3.7
2.2.3.4-2.2.3.7
3.2.3.2-3.2.3.254
4.2.3.3-4.2.3.253

cidrcomm's People

Contributors

tayaee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.