lp vs lpr. What to use in case of CUPS and what historical difference?

26,412

Solution 1

LPR is part of the original BSD printing system. It was fairly simple and straightforward, but it didn't have all the management capabilities that large print environments wanted. You could hack it to do all sorts of things by shoving filters in the right place, but it was pretty kludgy. It also included a very limited network functionality allowing you to send jobs to a remote printer, but since the protocol was only designed with plain text in mind, it never really had provisions for determining types of documents and translating them to what the printer could understand. Ad-hoc workarounds helped. Since the network protocol was so simple, lots and lots of network printers support it.

System V designed a bigger system which allowed you to have things like printer classes, and a print job would go to the first free printer in the class. (For example, if you had a machine room with three printers.) It also tried to build in more formalized support for filters and things like that, but alas, it's also really, really old and not really designed for networked environments.

Nowadays, nobody really uses either system. CUPS has taken over the print systems, but it offers the command line tools for both lpr and SYSV printing (lp). That's just for compatibility. You can use either command you find easiest.

Solution 2

CUPS itself has a nice page explaining the options for both: Command-Line Printing and Options. It states:

CUPS provides both the System V (lp) and Berkeley (lpr) printing commands for printing files.

Neither of the commands is considered preferred or superior. They are both included in CUPS to provide compatibility with both the System V and Berkeley legacy systems. Have a look at both program's man pages (lp, lpr) to see which options they support and use whichever one you like best!

Share:
26,412

Related videos on Youtube

mdcoder85
Author by

mdcoder85

Software developer and instructor. Mathematician by education. Daily use Emacs and Firefox under Debian )) Visit my home page: http://defun.work/ Resume: http://resume.defun.work/ Blog: http://blog.defun.work/ IT Tips: http://tips.defun.work/ Public source code: http://hg.defun.work/

Updated on September 18, 2022

Comments

  • mdcoder85
    mdcoder85 over 1 year

    My Debian distro provide the lp and lpr commands for printing from CUPS.

    I am a noob to printing in UNIX but have other tech skills.

    I tried to find a difference in man lp and man lpr. It seems that lp only have more options...

    The gv utility uses lp. I found older threads that explain that lpr is for network printing, while lp is a wrapper around lpr...

    I just enjoyed reading:

  • Superdooperhero
    Superdooperhero over 5 years
    If CUPS have taken over then what is the CUPS command used instead of lp and lpr?