在Linux/Unix中, pr命令用于通过添加适当的页脚, 页眉和格式化文本来准备要打印的文件。pr该命令实际上在页面的顶部和底部都添加了5行空白。标题部分显示文件的最后修改日期和时间以及文件名和页码。
语法如下:
pr [options][filename]
使用pr命令
1.要打印k列, 我们使用-k。假设我们有一个文件, 其中包含10个数字(从1到10), 每个数字都换行。

现在, 如果要在3列中打印此内容, 将使用以下命令。
pr -3 abc.txt
here abc.txt is the name of file.

2.要取消显示页眉和页脚, 请使用-t选项。
pr -t abc.txt
执行完上述命令后, 它将提供以下输出。

3.要使速度输入加倍, 减少混乱, 请使用-d选项。
pr -d abc.txt
执行完上述命令后, 它将提供以下输出。

4.要提供有助于调试代码的数字行, 请使用-n选项。
pr -n abc.txt
执行完上述命令后, 它将提供以下输出。

5.要打印命令的版本号, 请使用-version。
pr --version
执行命令后, 它将以下面提到的格式返回给我们版本。

6.要打开命令的帮助部分或获取命令的所有选项和属性的详细信息, 请使用–help。
pr --help
执行命令后, 它将以以下方式返回帮助部分。
