Forrest logo
back to the lp tool

lp:tldr:f0e65

lp: Print only certain pages to the default printer (print pages 1, 3-5, and 16).
$ lp -P 1,3-5,16 ${filenamename}
try on your machine

The command "lp -P 1,3-5,16 ${filename}" is used to print a file using the "lp" command.

Here's a breakdown of the command:

  • "lp": This is the command to print files.
  • "-P 1,3-5,16": This option specifies the pages to be printed. It indicates that you want to print pages 1, 3, 4, 5, and 16 of the file.
  • "${filename}": This is a placeholder that should be replaced with the actual name of the file you want to print. The command will print the specified pages of this file.

For example, if you have a file named "report.pdf" and you want to print pages 1, 3, 4, 5, and 16, you would run the command as follows:

lp -P 1,3-5,16 report.pdf

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the lp tool