User Tools

Site Tools


ubuntu:file:display_file_using_formatting

This is an old revision of the document!


Ubuntu - File - Display file using formatting

'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 file.

The most used 'pr' options are listed below.

OptionFunction
-xDivides the data into 'x' columns
-h “header”Assigns “header” value as the report header
-tDoes not print the header and top/bottom margins
-dDouble spaces the output file
-nDenotes all line with numbers
-l page lengthDefines the lines (page length) in a page. Default is 56
-o marginFormats the page by the margin number

Display into columns

pr -3 Filename

Displays the file content arranged in three columns.


Assign a header

pr -h "Header" Filename

Denote all lines with numbers

pr -n Filename

ubuntu/file/display_file_using_formatting.1576440739.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki