Prev | Current Page 1082 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"

For example, you can print the
output of a groff command by piping that output to lpr as follows:
$ groff -Tps -man /tmp/chown.1 | lpr -Plp0
CROSS-REF
579
Working with Words and Images 21
The enscript command (in the enscript package) is another useful tool for printing
plain-text files. It converts the files to PostScript and sends them to a printer or to a
specified file.
Checking the Print Queues
To check the status of print jobs that have been queued, you can use the lpq command. By itself,
lpq prints a listing of jobs that are in the queue for the default printer. For example:
$ lpq
hp is ready and printing
Rank Owner Job Files Total Size
active root 3 hosts 1024 bytes
1st root 7 (stdin) 625 bytes
2nd root 8 memo1.ps 12273 bytes
3rd chuck 9 bikes.ps 10880 bytes
The output from lpq shows the printer status and the files waiting to be printed. Rank lists the
order in which they are in the queue. Owner is the user who queued the job. Job shows the job
number. The Files column shows the name of the file or standard output (if the file was piped or
directed to lpr). Total Size shows how large each file is in bytes.
You can add options to lpq to print different kinds of information. By adding -Pprinter, you
can see the queue for any available printer.


Pages:
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094