Managing printers from the command line

Get a list of printers:

# lpstat -p -d
printer DCP7060D is idle.  enabled since Sunday 27 September 2015 11:13:03 PM IST
printer RICOH-SP-111-DDST is idle.  enabled since Sunday 27 September 2015 10:18:49 PM IST
system default destination: RICOH-SP-111-DDST

Print to a specific printer:

lp -d printer filename

Example:

# lp -d DCP7060D moddriver.txt
request id is DCP7060D-1 (1 file(s))

Set a default printer:

lpoptions -d printer

You can get a complete list of options from the help available on localhost


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.