Forrest logo
back to the lpr tool

lpr:tldr:b3dfc

lpr: Set page size (more options may be available depending on setup).
$ lpr -o media=${select} ${filename}
try on your machine

The command "lpr -o media=${select} ${filename}" is a command-line instruction that is used to print a file using the lpr (line printer) command with specific options.

Here's a breakdown of the command:

  • "lpr": This is the command itself, used for printing files.
  • "-o media=${select}": The "-o" flag is used to specify options for the print job. In this case, it is used to set the media (paper) type for printing. The value of the media option is set to "${select}", which suggests that it should be replaced with a specific paper type or size selected by the user when executing the command. For example, if the desired media is "A4", the command would be "lpr -o media=A4 ${filename}".
  • "${filename}": This is a placeholder for the actual file name you want to print. It should be replaced with the name (and path if necessary) of the file you want to send to the printer.

Overall, this command allows you to print a file with specific paper-type settings, which can be determined at the time the command is executed.

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 lpr tool