Shell script to delete all printers

Oct 11, '13 07:10:00AM

Contributed by: MacManager

The following shell script will delete all printers. Make sure the file is executable after you create it (chmod ugo+x /path/to/delPrinters.sh).


#!/bin/sh

for printer in `lpstat -p | awk '{print $2}'`
do
echo Deleting $printer
lpadmin -x $printer
done

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20131008152101707