LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 06-08-2009, 03:08 PM   #1
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
Print command failing


Just installed ubuntu 8.04 from a cd.
Code:
 
$ print notes
Warning: unknown mime-type for "notes" -- using "application/*"
Error: no "print" mailcap rules found for type "application/*"

Last edited by john test; 06-08-2009 at 03:46 PM.
 
Old 06-08-2009, 04:21 PM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
So long as we're both working off the same textbook, do you know what the 'print' command does, and what exactly is 'notes'. I suppose, also, do you know what mailcap does? Have you set any mailcap rules?
 
Old 06-09-2009, 08:10 AM   #3
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
Thanks for the response
As a Linux newbie, I ssume the print command is supposed to send the object to the default printer.
I have Samba and Cups running and I can print a test page from the cups app
Notes is a document that I use as a repository for code/command examples that I capture from this forum
So I am expecting "print notes" issued at the $ prompt in Terminal to print out the text from notes on my laserjet printer
I do not know what mailcap is.
I need some pretty basic stuff. Where is mailcap, what is mailcap and what rules shoud I set?
N
 
Old 06-09-2009, 10:12 AM   #4
hunternet93
Member
 
Registered: Jun 2009
Posts: 87

Rep: Reputation: 31
The "print" command is NOT to print to a printer (I think, correct me if I'm wrong). The easiest way is to use your WM's printing tools, I.E open the file "notes" in a program that can read it (navigate to it in a file manager and double-click it) and choose print from the file menu. If you want/need to print a file from the command line, use the LP set of tools. If your printer is already set up, type "lpr <file>" (replace <file> with the name of whatever file you want to print) and press enter (duh). This might not work with image files, it's best to use a GUI for that.
 
Old 06-09-2009, 12:18 PM   #5
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
OK Print seems to be inappropriate for printing from the command line to the printer
Pr seems to do something to format the file to make it ready for printing. but fails to adturally get it out to the printer
lp notes says something about no default destination and fails to sent anything to the printer

I have cups running and it has a default printer and I can use cups to print a test page.

Can you provide a command line example that I can use to print a text file while I am logged in via ssh?
 
Old 06-09-2009, 01:51 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
What does
lpstat -a
have to say?

Is CUPS running on the same machine you're trying to
print from?



Cheers,
Tinkster
 
Old 06-09-2009, 05:27 PM   #7
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
one vista machine sshed into Linux box
Linux Box is running cups and has the laserjet printer attached.
I can go on the Linux box and use gedit to open Notes and print it out

Code:
 # lpstat -a
hp_LaserJet_1320_series accepting requests since Mon 01 Jun 2009 01:00:46 PM EDT
PDF accepting requests since Tue 22 Apr 2008 05:56:20 PM EDT
What I want to do is ssh in and from the commnd prompt just print a text file.


TIA
 
Old 06-09-2009, 05:43 PM   #8
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,075

Rep: Reputation: 189Reputation: 189
Check out:

$ man lp
$ man lpr

Anyhoo, in your case:

Code:
$ lp -d hp_LaserJet_1320_series notes
or
$ lpr -P hp_LaserJet_1320_series notes
should do the trick.

cheers,
 
Old 06-09-2009, 06:33 PM   #9
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
Excellent! Thanks so much
Man pages don't work well for blind guys abd if course the seldom have on target examples
Now your responses on the other hand provide excellent examples.
Now that I have your working code, the man pages will begin to make more sense

Do you have any good words of advice on the Print and PR commands What are they used for and do you have examples for use?

Thanks again for your help
 
Old 06-09-2009, 06:48 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Ok ...

so what do
lpstat -a -v
lpstat -d
have to say?
 
Old 06-09-2009, 07:10 PM   #11
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
Thanks
Code:
 # lpstat -a -v
hp_LaserJet_1320_series accepting requests since Tue 09 Jun 2009 06:01:12 PM EDT
PDF accepting requests since Tue 22 Apr 2008 05:56:20 PM EDT
device for hp_LaserJet_1320_series: hp:/usb/hp_LaserJet_1320_series?serial=00CNHC58C038
device for PDF: cups-pdf:/
Code:
# lpstat -d
no system default destination
BTW Seems strange that cups knows about the default printer and so does vIm and gedit at the linux console but cant be used by vim's ha command across the ssh connection or by the lp and lpr commands across the ssh

Last edited by john test; 06-09-2009 at 07:11 PM.
 
Old 06-09-2009, 07:53 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hmmm ... while it appears that you have a printer defined in CUPS,
there's NO default queue. You can fix that with

lpadmin -d hp_LaserJet_1320_series

After that anything that makes use of lp or lpr will be able to
print w/o specifying the queue-name.


Cheers,
Tink
 
Old 06-09-2009, 08:02 PM   #13
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,275

Rep: Reputation: 126Reputation: 126
CUPS printer management is most easily done through your browser:

http://localhost:631/
 
Old 06-09-2009, 08:18 PM   #14
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
TINKSTER Thanks for your help
as it happens, I got a call from a friend up in New Jersey who gave me lpoptions -d hp_LaserJet_1320_series which did the trick
In any event your suggested lpadmin -d went into notes


It does get better -- As it happens, the lpoptions -d command that set the default destination for lp and lpr also resolved the problem where the esc:ha command in vim across the ssh did not print anything. the HA command did work when I executed vim from the inux console ??? strange stuff
Thanks for your help

Last edited by john test; 06-09-2009 at 08:27 PM.
 
Old 06-09-2009, 08:26 PM   #15
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
Quote:
Originally Posted by Quakeboy02 View Post
CUPS printer management is most easily done through your browser:

http://localhost:631/
Yes thank you
Cups and samba are working and cups is configured to provide a default printer for gedit and vim. The problem was that the default printer did not work across the ssh. usint lpoptions -d hp_LaserJet_1320_series allowed vim to use the printer when evoked across the ssh and also allowed lp and lpr to work across the ssh as well.

Do you know what print and pr are used for?
Do you know if there is an option or argument that will cause print or pr to print a text file to the default printer from the command line?
 
  


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
cp command failing for large files - Input/Output error googs Linux - General 5 08-09-2012 01:28 PM
XEN installation failing with hg command not found priyophan Linux - Server 1 04-25-2009 02:59 PM
mount -o loop command failing in startup script for RH 5 dougkdp76 Linux - General 3 01-12-2008 12:04 PM
eth1 failing on boot, IEEE firewire card driver failing, help jackuss_169 Linux - Laptop and Netbook 5 03-05-2005 08:34 AM
pring option in DHCP salahuddin_66 Slackware 1 06-26-2004 04:50 AM


All times are GMT -5. The time now is 01:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration