how do I select pages using lpr

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

how do I select pages using lpr

Postby kaykav on Wed Feb 10, 2010 7:29 pm

Hi,
Maybe someone can direct me to the answer. Using the command 'lpr' to print a 4 page file; what option or cmd do I use to just print the first 2 pages?
I can use the GUI dialog box,it gives me the option to select the range of pages,but how do I do that in the terminal?
Thank you.........
kaykav
Level 3
Level 3
 
Posts: 149
Joined: Tue Jan 06, 2009 12:09 am
Location: crossville tn

Linux Mint is funded by ads and donations.
 

Re: how do I select pages using lpr

Postby thenewguy on Wed Feb 10, 2010 9:22 pm

I'm not sure that lpr has a command switch to do that. If the file is text, you might be better off making a copy of the first two pages and saving them in a separate file. Something like

cat old_file.txt | head -n 50 > new_file.txt

Should grab the first 50 lines and dump them in a new file, which you could then print.
thenewguy
Level 3
Level 3
 
Posts: 189
Joined: Thu Feb 04, 2010 9:29 pm

Re: how do I select pages using lpr

Postby pompom on Thu Feb 11, 2010 4:05 am

Welcome to Linux Mint!

Suppose you wanted to print pages 5 and 6 out of 8 page total of my_letter, you would specify options with -o

Code: Select all
lpr -P myprinter -o page-ranges=5-6 my_letter
lpr -P myprinter -o page-ranges=1,5-6 my_letter (including title page)


other options can equally be set

Code: Select all
lpr -P myprinter -o page-set=odd my_letter (just odd number pages)
lpr -P myprinter -o page-set=even my_letter (even number pages only)


Cheers,

pompom
"This is Linux. It gives you cute mascot and enough rope to hang yourself." --- Miquel van Smoorenburg
pompom
Level 4
Level 4
 
Posts: 218
Joined: Mon Dec 14, 2009 2:27 am
Location: Komandorsky Archipelago, Kamchatka Peninsula

Re: how do I select pages using lpr

Postby kaykav on Thu Feb 11, 2010 6:25 pm

pompom,
thank you for that info. works fine. most of the time man -pages are ambiguous. thanks..............
kaykav
Level 3
Level 3
 
Posts: 149
Joined: Tue Jan 06, 2009 12:09 am
Location: crossville tn


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 37 guests