Mastering Printing from the Linux Command Line: Double-Sided, Landscape, and Advanced Options

Configuring your Linux machine to communicate with your local printer for tasks such as duplex or landscape printing might appear daunting, but it’s actually simpler than expected.

For those new to using their printers, it’s a good idea to first verify that the lp command is accessible in your environment path with a command like:

You can then verify your printer’s status with an lpstat command as shown here:

The -p option allows you to see the printer’s details, while the -d determines the default printer. This example assumes a single printer setup. Each of these options can also be used independently as illustrated below.

If you’re exploring different printer settings, the lpoptions command can be used as follows:

To break down each option into its own line, redirect the output of the lpoptions command through a command like the one below, which converts spaces in the output to newline characters (”), thus isolating each option. Pay attention to the various specifics as you examine them one by one using the more command. This includes details as specific as the colors of the toner cartridges in some cases.

If there are several printers connected, apply the -p option to select a specific one.

Utilizing the -v option, the lpinfo command will display drivers and other related information, including the printer’s IP address.

Now that we’ve explored all the information related to your printers, let’s delve into how to actually print documents.

To carry out printing on the default printer, simply utilize the lp command along with the document’s name that needs to be printed. If the document’s name contains spaces (which is uncommon in Linux environments), you can either enclose the name in quotes or start typing the document’s name and use the tab key to complete the filename automatically, as portrayed in the second illustration provided.

The lpq command is employed to check the list of documents in the printer queue. However, it is possible for some documents to be printed so rapidly that they are finished even before you press the enter key after issuing the “lpq” command, potentially resulting in no list being displayed. To circumvent this, I recommend placing the lpq command on the same command line to prevent the printing process from completing too swiftly.

By using the -n option with the lp command, you can designate the number of copies you desire to print.

To halt an ongoing print task, utilize the cancel or lprm command. However, be quick in your action because if there are many requests in the queue, the print job may finish before the cancellation command takes effect.

For duplex printing, employ the lp command along with the sides option. This lets you print on both sides of the sheet and determine the binding edge. Typically, this matches the expected orientation for two-sided portrait documents.

To consistently print documents in duplex, turning on the short edge, modify your lp settings using the lpoptions command to adjust the sides option.

Switching back to single-sided printing is straightforward. It’s generally more practical to select duplex as needed rather than altering the default setting permanently.

Understanding the distinction between using an option and altering a default setting is crucial. Employing an option is illustrated with the -o in the first command presented here. In contrast, the subsequent commands demonstrate changes to settings.</

For printing a document in landscape orientation, you can utilize the landscape option by incorporating it in the lp command, followed by the name of the file.

There are numerous possibilities for executing print commands through the Linux terminal. This discussion aims to shed light on how to recognize and employ the diverse options available with the lp command.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Article

Meet the AI Candidate: A Glimpse into the Future of Politics in the UK

Next Article

GameStop Exclusive: Preorder "Life is Strange: Double Exposure" and Score a Special Steelbook Case

Related Posts