Linux Commands - pr (format file for printing)

by
Jeremy Canfield |
Updated: March 14 2020
| Linux Commands articles
The pr command is intended to format a file for printing. For example, let's say the file named foo.txt has the following content.
Hello World
How are you today?
The PR command has a number of options to format the file. -n numbers the list, and -h adds a header named "Greetings".
pr -n -h "Greetings" foo.txt > bar.txt
Before printing, you may want to use the lpstat or lpc commands to list the available printers.
There are a few different commands that can be used to sent print jobs to the printer.
The lpq command can be used to view and cancel print jobs in the print queue. The lprm command can be used to remove print jobs.
Did you find this article helpful?
If so, consider buying me a coffee over at