'pr' command
This command helps in formatting
the file for printing on the terminal. There are many options available with
this command which help in making desired format changes on the file. The most
used 'pr' options are listed below.
Option
|
Function
|
-x
|
Divides the data into 'x' columns
|
-h "header"
|
Assigns "header" value as
the report header
|
-t
|
Does not print the header and
top/bottom margins
|
-d
|
Double spaces the output file
|
-n
|
Denotes all line with numbers
|
-l page length
|
Defines the lines (page length) in
a page. Default is 56
|
-o margin
|
Formats the page in accordance with
the margin number
|
Dividing data into columns
'Tools' is a file.
We want its content to be arranged
in three columns. The syntax for the same would be:
pr -x Filename
The '-x' option with the 'pr'
command divides the data into x columns.
Assigning a header
The syntax is:
pr -h "Header" Filename
The '-h' options assigns
"header" value as the report header
Denoting all lines with numbers
The syntax is:
pr -n Filename
This command denotes all the lines
in the file with numbers
These are some of the 'pr' command
options that you can use to modify the file format.
Printing a file
Once done with the formatting and
it is time to get a hard copy of the file, we need to use the following
command:
lp Filename
or
lpr Filename
In case we want to print multiple
copies of the file, we can use the number modifier.
In case we have multiple printers configured, we can
specify a particular printer using the Printer modifier
No comments:
Post a Comment