LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2017, 12:47 AM   #1
Parag.Deshmukh
LQ Newbie
 
Registered: Aug 2017
Posts: 1

Rep: Reputation: Disabled
lp and pr command


Please help me to understand the difference between lp and pr command. There is so much discussion about lp and lpr command. But I want to the difference mentioned in the captioned subject
 
Old 08-05-2017, 01:50 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,912
Blog Entries: 19

Rep: Reputation: 4575Reputation: 4575Reputation: 4575Reputation: 4575Reputation: 4575Reputation: 4575Reputation: 4575Reputation: 4575Reputation: 4575Reputation: 4575Reputation: 4575
pr doesn't actually print anything. It just adds some format codes to a plain text file. You specify which ones you want (default is just to add page headings), direct the output into a second file and then print that. Use man pr for further details.
 
Old 08-05-2017, 01:51 AM   #3
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
See
Code:
man ip
man
Code:
man pr
.

They are very different.

EDIT: My bad. I didn't recognize that as a lower case "L". I see where your confusion lies now. Do you see where mine did?

EDIT #2: Still, though. Man pages

Last edited by TheEzekielProject; 08-05-2017 at 01:55 AM.
 
Old 08-05-2017, 02:06 AM   #4
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
pr sort of formats the text file for printing.
lp requires the lp daemon to be running and manages printq queues and

For instance pr -l72 esql.out | lp formats text file output in esql.out to 12 inch paper set to 6 lines per inch (indian bulk fanfold stationary standard) which (in this case) prints on the default printer.

ok
 
Old 08-05-2017, 08:44 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,892
Blog Entries: 4

Rep: Reputation: 4000Reputation: 4000Reputation: 4000Reputation: 4000Reputation: 4000Reputation: 4000Reputation: 4000Reputation: 4000Reputation: 4000Reputation: 4000Reputation: 4000
Also note that in most cases the lp command spools a print-job to the CUPS subsystem which actually controls your printer. So, all printed output is handled the same way no matter how it is initiated.

In the very-old days, of course, your printer was connected by a very-thick cable to your computer's parallel port – which most computers don't even have, these days.

Both of these commands represent techniques that are no longer in common use.
 
Old 08-06-2017, 07:43 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,590
Blog Entries: 28

Rep: Reputation: 6221Reputation: 6221Reputation: 6221Reputation: 6221Reputation: 6221Reputation: 6221Reputation: 6221Reputation: 6221Reputation: 6221Reputation: 6221Reputation: 6221
The CUPS website has an excellent page on the lp command: https://www.cups.org/doc/options.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [SOLVED] bash script: can echo command, command works if I type, but command doesn't work in script ... why? hopeless_n00b Linux - Newbie 10 07-12-2018 05:57 AM
Does bash script has equivalent set /p command as Windows shell command? ncheng Linux - Newbie 5 06-30-2016 05:29 AM
Command/Script required to send an email alert in case command will not respond rajaniyer123 Linux - General 1 05-19-2012 01:12 PM
Executing shell command from JSP file with command line arg from URL orcusomega Programming 2 01-13-2012 03:38 PM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration