Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

Print from the command line

Date: 2010-11-11 00:00:00 -0400

This is a small old tip, but I want to share it here, in case it may be useful for someone.

Also as a note to myself, as I usually forget how to do it.

I usually like to print from the command line, when I am editing latex documents, programming, or creating markdown. I usually use vim to edit this kind of files.

So, if you need to print from the command line, and assuming you already have the printer installed and working.

lpr file

This will print the file on the default printer

lpr -P printername file

This will print the file on a specific printer, in this case named “printername”.

lpr -P printername -#3 file

This will print the file on the printer “printername”, and will print 3 copies.

lpr -p file

Print a pre-formated file with a shaded header containing, he date, time, job name, and page number.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.