Linux / Unix Shell: Set Default Printer

The default printer in Linux is usually set using the lpadmin command, which is part of the Common UNIX Printing System (CUPS). The lpadmin command can be used to manage printers and print queues on a Linux system.

Here’s how to set the default printer in Linux:

  1. Open a terminal window or log in to a virtual console.
  2. Type the following command to list all available printers on your system:
    lpstat -a

    This will display a list of all printers that are available for use on your system.

  3. Identify the name of the printer that you want to set as the default printer.
  4. Type the following command to set the specified printer as the default printer:
    lpadmin -d <printer-name>

    Replace <printer-name> with the name of the printer that you want to set as the default printer.

  5. Restart the CUPS printing system to apply the changes:
    sudo service cups restart
  6. Verify that the default printer has been set by using the following command:
    lpstat -d

    This should display the name of the default printer that you have set.

Note: The exact syntax and options for the lpadmin command may vary depending on the version of CUPS and the Linux distribution being used. It’s a good idea to consult the CUPS documentation for your specific distribution for more information.

Leave a Comment