Tuesday, 19 June 2012

Linux CUPS terminal printer quick cheatsheet

Adding a new printer without a PPD:  
  • lpadmin -p printer_name -E -v socket://
1. Finding an existing PPD for your printer if required:
  • lpinfo --make-and-model 'LaserJet 3390' -m
2. Copy the require line up to the first space, eg from above command:
  •     Output: gutenprint.5.2://hp-lj_3390/expert HP LaserJet 3390 - CUPS
  •     Used for -m: gutenprint.5.2://hp-lj_3390/expert
3. Adding a new printer with above ppd: 
  • lpadmin -p printer_name -E -v smb://user:pass@ -m gutenprint.5.2://hp-lj_3390/expert
Adding a new printer with a specific ppd: 
  • lpadmin -p printer_name -E -v serial:/dev/ttyS0?baud=115200 -m MyPrinter.ppd
Adding Location (-L) and Description (-D): 
  • lpadmin -p printer_name -L "13th floor" -D "Konica Minolta C250"
Setting printer as default: 
  • lpoptions -d printer_name
Printing a file eg. /etc/hosts: 
  • lpr -P printer_name /etc/hosts
Remove the printer from the system: 
  • lpadmin -x printer_name
View printer state and job list:
  • lpq -P printer_name
View status information for jobs for a specific printer: 
  • lpstat -P printer_name
Purge all jobs for a specific printer: 
  • lprm - -P printer_name
Enabling a stopped printer: 
  • cupsenable printer_name
Disabling a printer: 
  • cupsdisable printer_name
Some of the lpadmin -v types:
  • serial:/dev/ttyS0 (can add baud, eg: serial:/dev/ttyS0?baud=115200)
  • parallel:/dev/lp0
  • smb://user:pass@host/share
  • ipp://host:port/printer_name
  • lpd://host/printer


  1. Come across much innovative topic that peaks my interest. Let me bookmark your website whilst checking you out of mess hp 7640 printer troubleshooting

  2. You-re was ergo terrific! We do not assume I've detected anything like this Right before. Thus excellent to track down a person with some authentic applying for grants that this particular topic. hp 3630 printer offline

  3. A moment dark ink cartridge and diverse shades of dim help keep up an impartial tone, with the dim ink taking into consideration unobtrusive shading and in this way enhancing the nature of high contrast photographs. hp setup