UNIX Print Commands

Basic commands for printing

  $ lpr -Precycled myLetter.ps 
  $ lp -precycled myLetter.ps
  $ lpq -P<name of the printer>

If there's document waiting to be printed in the queue you selected, you can see a list of all the print job waiting (the printers are slow, no matter how many pages they can print per minute). Every document is indicated by his name and his job number. this number is useful mainly for the next command.

  $ lprm -P<name of the printer> job_number

With this command you can delete only your documents. You can't delete document in queue that are owned by other users. Only the System Administrator can delete from the queue document of others users.

  $ lpstat -t

You can find more advanced use of the lpr command in the section Advanced Printing Command

The default queue

Normally the default printer used by the system is the nearer to the workstation, but sometime you can desire a different behaviour. To change your default printer you use the lpoptions command. If you want change your default printer to cloud you can use:

  $ lpoptions -d cloud

From now every time you print something without specifiing the printer it will be sent to cloud as default. Beware that this configuration is written in your profile, so if you login in another computer (at the other end of corridor) your default printer is always cloud.