Thursday, 29 March 2018

Rename printer from command line in ubuntu.

Rename printer name from backend without GUI.

1. rename the printer name into /etc/cups/printers.conf
for E.g.


Stop cups service first
service cups stop  > /dev/null 2>&1

Replace the old name with new printer name
sed -i 's/'$OldName'/'$NewName'/g' /etc/cups/printers.conf

Restart cups service
service cups restart  > /dev/null 2>&1

2. Also need to rename the ppd of the old printer which is located at /etc/cups/ppd

rename the old printer ppd name 

mv /etc/cups/ppd/"$OldName".ppd  /etc/cups/ppd/"$NewName".ppd

Restart cups service

service cups restart

Change the PDF printer Output directory

Since Ubuntu 7.10, a PDF printer has been installed by default. The behavior of this feature has changed from Ubuntu 7.10, instead of aski...