I use Cygwin quite a lot, but I never tried printing from it until last night. I had assumed it would be difficult; it’s not. On Unix/Linux systems, you can print by piping commands to lpr (i.e. “local printer”). So, for instance, printing the results of ls -a (list all files in the current directory) to your printer (rather than the terminal window) would go like this:
Now, on Cygwin, you’ll get an error if you try this. Lpr won’t know which printer to target. Luckily, lpr has a -d option for setting the destination. You can define that destination as //machineName/printerName. If your printer name has spaces in it, just put in quotes:
The above will pipe the results of ipconfig (a DOS app, hence the “/all” format of the “show all” argument, rather than the more Unix-ish “-a”) to the local printer, as defined by the -d option.
The above has been handy in documenting my current network outages. Grrrr!