Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello. I recently installed an HPDeskJet using CUPS. The test page printed out great! Everything prints out perfectly from Mozilla and all the text editors like Kate and KWrite etc.
Sometimes when am doing my thing in the shell I like to quickly print out a certain .conf file to get a better look at it. When I use the lp or lpr commands,(E.G. lp httpd.conf or lpr httpd.conf) the files print out with letters chopped off. The first two or three letters of each line are gone and the first few lines on the top of the file are chopped off as well.
Its not really a big deal since I can just open up an editor and print it from there but I would like the convenience of doing it from the shell if possible. Am I missing a certain flag in the lp command or is this something else?
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207
Rep:
You have the specify the prinetr filter to use. Say if my printer name i insatlled with cups/apsfiletr is Epson-high-quality, i would issue:
$ lpr -P Epson-high-quality <filename>
And it should work fine as long as the printer specified is in /etc/printcap. At least it's like this with APSfilter/lpr, i dont use CUPS but i assume it would be the same. Or alternatevily you can try to "low-level" way
$ cat <filename> > /dev/printer or /dev/lp0 depending if the symlinks are correctly in place...
HTH
-NSKL
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207
Rep:
Hmm.. Maybe CUPS doesn't use the "usual" lpr -P thing... I never used it so i'm not much help now... but try to read some CUPS docs, maybe you need to do something like cups -P printername <filename>. I have no idea...
Sorry
-NSKL
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
Quote:
Originally posted by Crashed_Again Well my printer name is HP-DeskJet-3820 so I tried
lpr -P HP-DeskJet-3820 test.txt
and it didn't work. Checking the /etc/printcap file shows a
HP-DeskJet-3820:
entry. The last bit about cat test.txt > /dev/lp0 just locks up the printer. No dice!
What do you mean ". . .it didn't work"? Did it not print anything,
or did it print the same stairstep as usual?
How are you setting up the CUPS config file? are you using a
GUI, a web browser, or a text editor?
Post the entry about your printer from /etc/printcap, as well as the
entry from /etc/cups/printers.conf.
By saying it didn't work I meant it prints the same stairstep as usual. I am setting up CUPS through the web browser. As I said in my original post everything else prints fine except lp or lpr from a shell.
There is only one line in the /etc/printcap file and it is:
HP-DeskJet-3829:
Here is printers.conf:
# Printer configuration file for CUPS v1.1.18
# Written by cupsd on Sun 26 Jan 2003 04:11:54 PM GMT
<DefaultPrinter HP-DeskJet-3820>
Info HP-DeskJet-3820
Location The-Alter
DeviceURI parallel:/dev/lp0
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
Shouldn't there be more in the /etc/printcap file?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.