Linux install printer
initialization script https://oss.cut-os.com/resources/player/init-printer.sh
Set up CUPS remote access
cupsctl --remote-admin —remote-any
Delete the printer (take Canon as an example)
lpadmin -x Canon
Detect and get USB printer
lpinfo -v | grep usb | xargs | sed -e s/direct//g | xargs
Add printer (-E enables -m driver -v URI, detected by the previous command, driver reference cups.org)
lpadmin -p HPLaserJet -E -m drv:///sample.drv/laserjet.ppd -v usb://HP/LaserJet%20M403d?serial=PHCLH51770
Set default printer
lpadmin -d HPLaserJet
Enable duplex (if you want to enable double-sided printing, you need to enable this option first)
lpadmin -p HPLaserJet -o Option1=True
Set paper size
lpadmin -p HPLaserJet -o media=A4
Set up duplex printing
lpadmin -p HPLaserJet-o sides=two-sided-long-edge
Set up one-sided printing
lpadmin -p HPLaserJet -o sides=one-sided