I am trying to figure out how to print a Postscript file double sided from the command line using lpr or lp commands. Of course I have found lots on the web telling me how to do this but they don't work for me; the file always gets printed single sided.
Ubuntu 20.04.6 MATE 1.24.0 CUPS 2.3.1-9ubuntu1.9
The only printer is a HP Color Laserjet Pro M255dw connected wirelessly via a router. It is the default printer as shown by "lpstat -d" (I don't know if this is a "network printer" or not or whether it makes any difference.)
lp and lpr are not aliased to anything; the binaries came with the system.
The PostScript file was created with "enscript" enscript -DDuplex:true file just prints single sided.
Printing double sided from various apps that present a print dialog, e.g. evince, works fine, so there is no doubt about the printer.
The lp man page shows -o sides=two-sided-long-edge as a common option. https://www.cups.org/doc/options.html tells me the same thing. Various other web pages tell me the same thing.
It doesn't work for me, either with Postscript or plain text; the output is still single sided. No errors or warnings. I have tried various other options for lp and lpr; all always print single sided. (Note: the printer output is formatted; i.e. it is not printing the PostScript source.)
lpoptions | tr ' ' '\n' ; I see nothing sbout a "sides" option.
lpoptions -l | grep -i side gives Duplex/2-Sided Printing: *None DuplexNoTumble DuplexTumble but lp -o Duplex=DuplexNoTumble file still prints single sided
hplipand/orhp-setupto set up and configure the printer driver for the specifics of the printer. Not an answer because I can neither test nor confirm this suggestion