Linux pr Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux pr Guide
Complete beginner-friendly guide to pr on Linux, covering Arch Linux, CachyOS, and other distributions including text formatting, pagination, and print preparation.
Table of Contents
pr Basics
Format for Printing
Basic usage:
# Format for printing
pr file.txt
# Formats with headers and page breaks
Simple Format
Basic format:
# Simple format
pr file.txt
# Adds headers and pagination
Page Formatting
Page Length
Set page length:
# Page length
pr -l 50 file.txt
# -l = length (50 lines per page)
Page Width
Set width:
# Page width
pr -w 80 file.txt
# -w = width (80 characters)
Column Formatting
Multiple Columns
Column format:
# Multiple columns
pr -2 file.txt
# -2 = 2 columns
Column Width
Column width:
# Column width
pr -2 -w 40 file.txt
# 2 columns, 40 chars each
Headers and Footers
Custom Header
Set header:
# Custom header
pr -h "My Document" file.txt
# -h = header (custom header text)
No Header
Remove header:
# No header
pr -t file.txt
# -t = no header/footer
Troubleshooting
pr Not Found
Check installation:
# pr is part of coreutils
# Usually pre-installed
# Check pr
which pr
Summary
This guide covered pr usage, text formatting, and print preparation for Arch Linux, CachyOS, and other distributions.
Next Steps
- fmt Guide - Text formatting
- fold Guide - Line wrapping
- Text Processing - Text manipulation
- pr Documentation:
man pr
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.