Today I Learned

hashrocket A Hashrocket project

Printing with lpr

Recently while trying to fix a printer I used lpr a bunch of times. It's not exactly new to me, but never fails to surprise people when I use it.

lpr submits files for printing to your default printer in OSX.

Print a file:


Print the current file in your Vim session, with a cool job name:

:! lpr -T 'cool job name' %

Print two copies to a specific printer:

lpr -# 2 -P specific_printer

This is an invaluable command-line trick.

See More #command-line TILs