Linux - NewbieThis 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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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?
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?
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.
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?
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?
# 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:/
# 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
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
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?