Skip to content

Instantly share code, notes, and snippets.

@skuschel
Created May 16, 2019 02:21
Show Gist options
  • Save skuschel/2bbf8b17f3c4696faa0a7744231d684c to your computer and use it in GitHub Desktop.
Save skuschel/2bbf8b17f3c4696faa0a7744231d684c to your computer and use it in GitHub Desktop.
CUPS remove all printers pointing to /dev/null
#!/bin/bash
# Stephan Kuschel, 2019
# Works the regex grabbing the printers requires works if computer is set to german. Change sed cmd
# accordingly if this is not the case.
lpstat -s | grep null | sed 's#Gerät für \(.*\): ///dev/null#\1#' | xargs -n1 lpadmin -x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment