Console Print Control


As with nearly everything else in Linux, you don't need X running to print a file. CUPS answers shell commands very well, and if for some reason the CUPS daemon won't run, you still have access to the old UNIX/Linux print standard, LPRng, which responds to the same commands. This section will cover how to print from your command line.

Tip

If you don't know much about the shell or console, there's much more in Chapter 8, "Shaking Hands with Your Shell."


Using Basic Print Commands

It's good to know these five basic shell commands if you just need to print something quickly without having to launch a program or wait for a GUI to load. These will work from any shell prompt, whether you have X running or not. In some cases, you need to be logged in as the SuperUser to have access to all options.

  • lp <options> <filename> <printer> The basic "line printer" spooling command.

  • lpq the "line printer queue," Tells you what print jobs are currently being processed. It will also give you the name(s) of the printer queue(s) installed on this machine if you do not know what's available.

  • lpstat Statistical information from the server and printer.

  • lprm Cancels the current print job.

  • lpadmin The CUPS line printer administration system. You must be Root (or SuperUser) to use. This command manages spooling, the print daemon, and all printer activity.

All these commands have reasonably good man pages, and you can also examine the CUPS Administration Guide in /usr/share/doc/packages/cups/sam.html.

Don't be afraid to use wildcards when using the lp command to print from the shell. To print all OpenOffice.org Writer documents in the current directory to a printer called "lp," type the following:

lp -dlp *.sxw 

Now if you run the queue command, lpq, you will see the file(s) being printed. This includes other pertinent information, such as the owner, the job number, and size of the job. CUPS uses the job number to handle multiple orders.

Armed with a job number, you can cancel that specific job with lprm <jobnumber>.



SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net