Rechercher une page de manuel

Chercher une autre page de manuel:


Langue: en

Version: 258538 (debian - 07/07/09)

Section: 1 (Commandes utilisateur)


grepcidr --- Filter IP addresses matching IPv4 CIDR/network specification


grepcidr [-V] [-c] [-v] [-e pattern | -f file]


This manual page documents briefly the grepcidr command.

This manual page was written for the Debian distribution because the original program does not have a manual page.

grepcidr can be used to filter a list of IP addresses against one or more Classless Inter-Domain Routing (CIDR) specifications, or arbitrary networks specified by an address range. As with grep, there are options to invert matching and load patterns from a file. grepcidr is capable of comparing thousands or even millions of IPs to networks with little memory usage and in reasonable computation time.


Show software version
Display count of the matching lines, instead of showing the lines
Invert the sense of matching, to select non-matching IP addresses
Specify pattern(s) on command-line
Obtain CIDR and range pattern(s) from file


grepcidr -f ournetworks blocklist > abuse.log

Find our customers that show up in blocklists

grepcidr iplog

Searches for any localnet IP addresses inside the iplog file

grepcidr "" iplog

Searches for IPs matching indicated range in the iplog file

script | grepcidr -vf whitelist > blacklist

Create a blacklist, with whitelisted networks removed (inverse)

grepcidr -f list1 list2

Cross-reference two lists, outputs IPs common to both lists


This manual page was written by Ryan Finnie for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation.

On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.


P : T'es en train de nous chier un chapelet !
M : Ouais... Et le plus dur, c'est de faire la croix...