ippfind(1)

πŸ“¦
version 2.4.19 Β· 5 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– ippfind(1) β€” the OpenPrinting girlies' guide to finding your printers πŸ’–

okay so bestie, welcome to ippfind, one of the OpenPrinting crew ✨ She's a whole icon: she goes out and finds services registered with a DNS server, or services chillin' on your local devices. Her main character purpose? Find IPP printers, show their URIs, show their current status, or run commands. Periodt. πŸ’…


🌸 SYNOPSIS 🌸

ippfind [ options ] regtype[,subtype][.domain.] ... [ expression
 ... ]
ippfind [ options ] name[.regtype[.domain.]] ... [ expression
 ... ]
ippfind --help
ippfind --version

✨ DESCRIPTION ✨

ippfind finds services registered with a DNS server or available through local devices. Its primary purpose is to find IPP printers and show their URIs, show their current status, or run commands. Like, she's not just a finder, she's a lifestyle. πŸ¦‹


πŸŽ€ REGISTRATION TYPES πŸŽ€

ippfind supports the following registration types:

  • _http._tcp β€” HyperText Transport Protocol (HTTP, RFC 2616)
  • _https._tcp β€” Secure HyperText Transport Protocol (HTTPS, RFC 2818)
  • _ipp._tcp β€” Internet Printing Protocol (IPP, RFC 2911)
  • _ipps._tcp β€” Secure Internet Printing Protocol (IPPS, draft)
  • _printer._tcp β€” Line Printer Daemon (LPD, RFC 1179)

🧚 EXPRESSIONS 🧚

So ippfind supports expressions much like the find(1) utility. But β€” and this is the plot twist β€” unlike find(1), ippfind uses POSIX regular expressions instead of shell filename matching patterns. No cap. 😀

And here's the lil default-behaviour moment: if --exec, -l, --ls, -p, --print, --print-name, -q, --quiet, -s, or -x is not specified, ippfind adds --print to print the service URI of anything it finds. She's helpful like that. 🫢

The following expressions are supported:

  • -d regex, --domain regex β€” True if the domain matches the given regular expression.
  • --false β€” Always false. (the hater of the group πŸ’€)
  • -h regex, --host regex β€” True is the hostname matches the given regular expression. (yes, the manpage says "True is", we're keeping it, character for character bestie 😭)
  • -l, --ls β€” Lists attributes returned by Get-Printer-Attributes for IPP printers and traditional find "-ls" output for HTTP URLs. The result is true if the URI is accessible, false otherwise.
  • --local β€” True if the service is local to this computer.
  • -N name, --literal-name name β€” True if the service instance name matches the given name.
  • -n regex, --name regex β€” True if the service instance name matches the given regular expression.
  • --path regex β€” True if the URI resource path matches the given regular expression.
  • -P number[-number], --port number[-number] β€” True if the port matches the given number or range.
  • -p, --print β€” Prints the URI if the result of previous expressions is true. The result is always true.
  • -q, --quiet β€” Quiet mode - just returns the exit codes below.
  • -r, --remote β€” True if the service is not local to this computer.
  • -s, --print-name β€” Prints the service instance name if the result of previous expressions is true. The result is always true.
  • --true β€” Always true. (the supportive bestie 🌈)
  • -t key, --txt key β€” True if the TXT record contains the named key.
  • --txt-key regex β€” True if the TXT record contains the named key and matches the given regular expression.
  • -u regex, --uri regex β€” True if the URI matches the given regular expression.
  • -x utility [ argument ... ] ;, --exec utility [ argument ... ] ; β€” Executes the specified program if the current result is true. "{foo}" arguments are replaced with the corresponding value - see SUBSTITUTIONS below.

πŸ’œ Modifiers, because expressions can have layers πŸ’œ

Expressions may also contain modifiers:

  • ( expression ) β€” Group the result of expressions.
  • ! expression, --not expression β€” Unary NOT of the expression.
  • expression expression, expression --and expression β€” Logical AND of expressions.
  • expression --or expression β€” Logical OR of expressions.

πŸ“ SUBSTITUTIONS πŸ“

The substitutions for "{foo}" in -e and --exec are:

  • {service_domain} β€” Domain name, e.g., "example.com.", "local.", etc.
  • {service_hostname} β€” Fully-qualified domain name, e.g., "printer.example.com.", "printer.local.", etc.
  • {service_name} β€” Service instance name, e.g., "My Fine Printer".
  • {service_port} β€” Port number for server, typically 631 for IPP and 80 for HTTP.
  • {service_regtype} β€” DNS-SD registration type, e.g., "_ipp._tcp", "_http._tcp", etc.
  • {service_scheme} β€” URI scheme for DNS-SD registration type, e.g., "ipp", "http", etc.
  • {}, {service_uri} β€” URI for service, e.g., "ipp://printer.local./ipp/print", "http://printer.local./", etc.
  • {txt_key} β€” Value of TXT record key (lowercase).

πŸ’… OPTIONS πŸ’…

ippfind supports the following options:

  • --help β€” Show program help.
  • --version β€” Show program version.
  • -4 β€” Use IPv4 when listing.
  • -6 β€” Use IPv6 when listing.
  • -T seconds β€” Specify find timeout in seconds. If 1 or less, ippfind stops as soon as it thinks it has found everything. The default timeout is 1 second.
  • -V version β€” Specifies the IPP version when listing. Supported values are "1.1", "2.0", "2.1", and "2.2".

πŸ‘‘ EXIT STATUS πŸ‘‘

ippfind 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
  • 4 β€” if it ran out of memory
four means she ran out of memory, bestie, she's literally fighting for her life 😭 give her a minute

🌈 ENVIRONMENT 🌈

When executing a program, ippfind sets the following environment variables for the matching service registration:

  • IPPFIND_SERVICE_DOMAIN β€” Domain name, e.g., "example.com.", "local.", etc.
  • IPPFIND_SERVICE_HOSTNAME β€” Fully-qualified domain name, e.g., "printer.example.com.", "printer.local.", etc.
  • IPPFIND_SERVICE_NAME β€” Service instance name, e.g., "My Fine Printer".
  • IPPFIND_SERVICE_PORT β€” Port number for server, typically 631 for IPP and 80 for HTTP.
  • IPPFIND_SERVICE_REGTYPE β€” DNS-SD registration type, e.g., "_ipp._tcp", "_http._tcp", etc.
  • IPPFIND_SERVICE_SCHEME β€” URI scheme for DNS-SD registration type, e.g., "ipp", "http", etc.
  • IPPFIND_SERVICE_URI β€” URI for service, e.g., "ipp://printer.local./ipp/print", "http://printer.local./", etc.
  • IPPFIND_TXT_KEY β€” Values of TXT record KEY (uppercase).

πŸ”₯ EXAMPLES πŸ”₯

To show the status of all registered IPP printers on your network, run:

ippfind --ls

Similarly, to send a PostScript test page to every PostScript printer, run:

ippfind --txt-pdl application/postscript --exec ipptool
  -f onepage-letter.ps '{}' print-job.test \;

like?? the {} gets swapped for the real URI and off it goes. iconic behaviour, honestly. 🌟


πŸ¦‹ SEE ALSO πŸ¦‹

ipptool(1)


Copyright Β© 2020-2024 by OpenPrinting.


and that's the whole page, bestie β€” brought to you by the fine folks at ippsample, dated 2021-02-28, and yeah the manual page itself is literally named ippfind(1) too, we've come full circle πŸŽ€ stay slaying, go find those printers, ily πŸ’œ

πŸ“¦ where this page comes from