.TH "GREPCIDR" "1" .SH "NAME" grepcidr \(em Filter IP addresses matching IPv4 CIDR/network specification .SH "SYNOPSIS" .PP \fBgrepcidr\fR [\fB-V\fP] [\fB-c\fP] [\fB-v\fP] [\fB-e \fIpattern\fR\fP | \fB-f \fIfile\fR\fP] .SH "DESCRIPTION" .PP This manual page documents briefly the \fBgrepcidr\fR command. .PP This manual page was written for the \fBDebian\fP distribution because the original program does not have a manual page. .PP \fBgrepcidr\fR 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. .SH "OPTIONS" .IP "\fB-V\fP" 10 Show software version .IP "\fB-c\fP" 10 Display count of the matching lines, instead of showing the lines .IP "\fB-v\fP" 10 Invert the sense of matching, to select non-matching IP addresses .IP "\fB-e\fP" 10 Specify pattern(s) on command-line .IP "\fB-f\fP" 10 Obtain CIDR and range pattern(s) from file .SH "EXAMPLES" .PP \fI\fBgrepcidr\fP \-f ournetworks blocklist > abuse.log\fP .PP Find our customers that show up in blocklists .PP \fI\fBgrepcidr\fP 127.0.0.0/8 iplog\fP .PP Searches for any localnet IP addresses inside the iplog file .PP \fI\fBgrepcidr\fP "192.168.0.1-192.168.10.13" iplog\fP .PP Searches for IPs matching indicated range in the iplog file .PP \fI\fBscript\fP | \fBgrepcidr\fP \-vf whitelist > blacklist\fP .PP Create a blacklist, with whitelisted networks removed (inverse) .PP \fI\fBgrepcidr\fP \-f list1 list2\fP .PP Cross-reference two lists, outputs IPs common to both lists .SH "AUTHOR" .PP This manual page was written by Ryan Finnie ryan@finnie.org for the \fBDebian\fP 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. .PP On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. .\" created by instant / docbook-to-man, Sun 04 Sep 2011, 13:49