Friday, August 13, 2010

print commands in Linux

To see a list of available printers:

# lpstat -p -d

To print the file to printer "MyPrinter"

# lpr -P MyPrinter filename

To view (query) the print queue, use the lpq or lpstat command. When entered without arguments, it displays the contents of the default print queue.

# lpq
# lpstat

To list the default printer

# lpstat -d

To know the status of default printer

# lpstat -p

If the printer status is disabled, you need to enable the printer using "enable" command as follows.

# /usr/bin/enable <PrinterName>

To disable the printer

# /usr/bin/disable -c <PrinterName>

To reset the print queue, you have to disable and reenable as follows

# /usr/bin/disable -c <PrinterName>
# /usr/bin/enable <PrinterName>

To remove the print job

# lprm <job Number>

No comments: