Skip to main content
Engineering LibreTexts

09-B.2.1: Configuring Linux Devices - Printing

  • Page ID
    39115
  • CUPS

    CUPS (formerly an acronym for Common UNIX Printing System) is a modular printing system for Unix-like computer operating systems which allows a computer to act as a print server. A computer running CUPS is a host that can accept print jobs from client computers, process them, and send them to the appropriate printer.

    CUPS consists of a print spooler and scheduler, a filter system that converts the print data to a format that the printer will understand, and a backend system that sends this data to the print device. CUPS uses the Internet Printing Protocol (IPP) as the basis for managing print jobs and queues.

    There is a web based interface as shown in the following image:

    The CUPS web based configuration interface. Most implementations of Linux can make use of this tool to manage printers attached to the server or to the network
    Figure \(\PageIndex{1}\): CUPS Administrative Interface ("Cups Interface" by Patrick McClanahan is licensed under CC BY-SA 4.0)

    This interface, as shown in the URL bar, is at localhost:631/admin. It is possible to configure printers from this interface.These changes are saved in /etc/cups/supsd.conf and /etc/cups/cups-files.conf.

    In order to perform administrative tasks via the web interface, a user must either have the root account enabled on the server, or authenticate as a user in the lpadmin group. For security reasons, CUPS won’t authenticate a user that doesn’t have a password.

    The use of CUPS greatly simplifies the installation and configuration of printers on a Linux system.

    The lpr Command

    The lpr command submits files for printing. Files named in a shell session route to the named printer or to the system default destination if no destination is specified. If no files are listed, lpr reads the print file from the standard input.

    Syntax:

    lpr [ OPTIONS ] [FILENAMES]

    Command Options:

    Options Options Meaning
    E Forces encryption when connecting to the server.
    -H server[:port] Specifies an alternate server.

    -P [destination[/instance]

    Prints files to the named printer.
    -U username Specifies an alternate username.
    -# copies Sets the number of copies to print from 1 to 100.
    -h Disables banner printing. This option is equivalent to "-o job-sheets=none".
    -l Specifies that the print file is already formatted for the destination and should be sent without filtering. This option is equivalent to "-o raw".
    -m Sends an email when a job is complete.
    -o option[=value] Sets a job option.
    -p Specifies that the print file should be formatted with a shaded header with the date, time, job name, and page number. This option is equivalent to "-o prettyprint" and is only useful when printing text files.
    -q Hold job for printing.
    -r Specifies that the named print files should be deleted after printing them.
    • Was this article helpful?