CIDR(1) CIDR(1)
NAME
cidr - search files for ip address patterns
SYNOPSIS
ip/cidr [ -cLlnrsv ] pattern | [ -f patternfile ] file
DESCRIPTION
Cidr is analogous to grep(1) for IP addresses. The input is
searched for tokens that match the pattern, a set of
whitespace-seperated CIDRs or CIDRs negated with '~'. The
options are
-c Print only a count of matching lines.
-l (ell) Print the names of files with selected lines;
don't print the lines.
-L Print the names of files with no selected lines; the
converse of -l.
-n Mark each printed line with its line number counted in
its file.
-r Reverse the meaning of the pattern and tokens.
-s Produce no output, but return status.
-v Reverse: print lines that do not match the pattern.
-f The pattern argument is the name of a file containing
regular expressions one per line.
The format of the pattern is standard CIDR notation. A `~'
may prefix the CIDR to negate the match. These are all
legal patterns
10.220.0.1
10.220.0.1/18
~fc00::/7
See /lib/badcidr for a list of RFC3330 unroutable or illegal
CIDRs.
SOURCE
/sys/src/cmd/ip/cidr.c
SEE ALSO
/lib/rfc/rfc3330
BUGS
Combinations of -v, -r and patterns with `~' can be mislead-
ing.
Missing a `' verb.
Page 1 Plan 9 (printed 11/8/25)