2 .\" ippfind man page for CUPS.
4 .\" Copyright © 2013-2018 by Apple Inc.
6 .\" These coded instructions, statements, and computer programs are the
7 .\" property of Apple Inc. and are protected by Federal copyright
8 .\" law. Distribution and use rights are outlined in the file "LICENSE.txt"
9 .\" which should have been included with this file. If this file is
10 .\" file is missing or damaged, see the license at "http://www.cups.org/".
12 .TH ippfind 1 "CUPS" "14 February 2018" "Apple Inc."
14 ippfind \- find internet printing protocol printers
19 ] \fIregtype\fR[\fB,\fIsubtype\fR][\fB.\fIdomain\fB.\fR] ... [
26 ] \fIname\fR[\fB.\fIregtype\fR[\fB.\fIdomain\fB.\fR]] ... [
36 \fBippfind\fR finds services registered with a DNS server or available through local devices.
37 Its primary purpose is to find IPP printers and show their URIs, show their current status, or run commands.
38 .SS REGISTRATION TYPES
39 \fBippfind\fR supports the following registration types:
42 HyperText Transport Protocol (HTTP, RFC 2616)
45 Secure HyperText Transport Protocol (HTTPS, RFC 2818)
48 Internet Printing Protocol (IPP, RFC 2911)
51 Secure Internet Printing Protocol (IPPS, draft)
54 Line Printer Daemon (LPD, RFC 1179)
56 \fBippfind\fR supports expressions much like the
61 \fBippfind\fR uses POSIX regular expressions instead of shell filename matching patterns.
62 If \fI\-\-exec\fR, \fI\-l\fR, \fI\-\-ls\fR, \fI\-p\fR, \fI\-\-print\fR, \fI\-\-print\-name\fR, \fI\-q\fR, \fI\-\-quiet\fR, \fI\-s\fR, or \fI\-x\fR is not specified, \fBippfind\fR adds \fI\-\-print\fR to print the service URI of anything it finds.
63 The following expressions are supported:
67 \fB\-\-domain \fIregex\fR
68 True if the domain matches the given regular expression.
75 \fB\-\-host \fIregex\fR
76 True is the hostname matches the given regular expression.
81 Lists attributes returned by Get-Printer-Attributes for IPP printers and traditional \fIfind\fR "-ls" output for HTTP URLs.
82 The result is true if the URI is accessible, false otherwise.
85 True if the service is local to this computer.
89 \fB\-\-literal\-name \fIname\fR
90 True if the service instance name matches the given name.
94 \fB\-\-name \fIregex\fR
95 True if the service instance name matches the given regular expression.
97 \fB\-\-path \fIregex\fR
98 True if the URI resource path matches the given regular expression.
100 \fB\-P \fInumber\fR[\fB-\fInumber\fR]
102 \fB\-\-port \fInumber\fR[\fB-\fInumber\fR]
103 True if the port matches the given number or range.
108 Prints the URI if the result of previous expressions is true.
109 The result is always true.
114 Quiet mode - just returns the exit codes below.
119 True if the service is not local to this computer.
124 Prints the service instance name if the result of previous expressions is true.
125 The result is always true.
133 True if the TXT record contains the named key.
135 \fB\-\-txt\-\fIkey regex\fR
136 True if the TXT record contains the named key and matches the given regular expression.
140 \fB\-\-uri \fIregex\fR
141 True if the URI matches the given regular expression.
143 \fB\-x \fIutility \fR[ \fIargument \fR... ] \fB;\fR
145 \fB\-\-exec \fIutility \fR[ \fIargument \fR... ] \fB;\fR
146 Executes the specified program if the current result is true.
147 "{foo}" arguments are replaced with the corresponding value - see SUBSTITUTIONS below.
149 Expressions may also contain modifiers:
151 \fB( \fIexpression \fB)\fR
152 Group the result of expressions.
154 \fB! \fIexpression\fR
156 \fB\-\-not \fIexpression\fR
157 Unary NOT of the expression.
159 \fIexpression expression\fR
161 \fIexpression \fB\-\-and \fIexpression\fR
162 Logical AND of expressions.
164 \fIexpression \fB\-\-or \fIexpression\fR
165 Logical OR of expressions.
167 The substitutions for "{foo}" in \fI\-e\fR and \fI\-\-exec\fR are:
170 Domain name, e.g., "example.com.", "local.", etc.
172 .B {service_hostname}
173 Fully-qualified domain name, e.g., "printer.example.com.", "printer.local.", etc.
176 Service instance name, e.g., "My Fine Printer".
179 Port number for server, typically 631 for IPP and 80 for HTTP.
182 DNS-SD registration type, e.g., "_ipp._tcp", "_http._tcp", etc.
185 URI scheme for DNS-SD registration type, e.g., "ipp", "http", etc.
190 URI for service, e.g., "ipp://printer.local./ipp/print", "http://printer.local./", etc.
192 \fB{txt_\fIkey\fB}\fR
193 Value of TXT record \fIkey\fR (lowercase).
195 \fBippfind\fR supports the following options:
201 Show program version.
204 Use IPv4 when listing.
207 Use IPv6 when listing.
210 Specify find timeout in seconds.
211 If 1 or less, \fBippfind\fR stops as soon as it thinks it has found everything.
212 The default timeout is 1 second.
215 Specifies the IPP version when listing.
216 Supported values are "1.1", "2.0", "2.1", and "2.2".
218 \fBippfind\fR returns 0 if the result for all processed expressions is true, 1 if the result of any processed expression is false, 2 if browsing or any query or resolution failed, 3 if an undefined option or invalid expression was specified, and 4 if it ran out of memory.
220 When executing a program, \fBippfind\fR sets the following environment variables for the matching service registration:
222 .B IPPFIND_SERVICE_DOMAIN
223 Domain name, e.g., "example.com.", "local.", etc.
225 .B IPPFIND_SERVICE_HOSTNAME
226 Fully-qualified domain name, e.g., "printer.example.com.", "printer.local.", etc.
228 .B IPPFIND_SERVICE_NAME
229 Service instance name, e.g., "My Fine Printer".
231 .B IPPFIND_SERVICE_PORT
232 Port number for server, typically 631 for IPP and 80 for HTTP.
234 .B IPPFIND_SERVICE_REGTYPE
235 DNS-SD registration type, e.g., "_ipp._tcp", "_http._tcp", etc.
237 .B IPPFIND_SERVICE_SCHEME
238 URI scheme for DNS-SD registration type, e.g., "ipp", "http", etc.
240 .B IPPFIND_SERVICE_URI
241 URI for service, e.g., "ipp://printer.local./ipp/print", "http://printer.local./", etc.
243 .B IPPFIND_TXT_\fIKEY\fR
244 Values of TXT record \fIKEY\fR (uppercase).
246 To show the status of all registered IPP printers on your network, run:
252 Similarly, to send a PostScript test page to every PostScript printer, run:
255 ippfind \-\-txt\-pdl application/postscript \-\-exec ipptool
256 \-f onepage\-letter.ps '{}' print\-job.test \\;
261 Copyright \[co] 2013-2018 by Apple Inc.