pr命令用法#
pr输出时会进行分页,并可选择以多栏格式显示;也可选择合并所有文件,将它们并行打印,每列显示一个文件。
默认情况下,每页都会打印一个包含 5 行内容的页眉:两行空白行;一行包含日期、文件名和页码信息的内容;以及另外两行空白行。此外,还会打印一个包含 5 个空白行的页脚。默认的页面长度(page_length)为 66 行,因此实际的文本行数为 56 行。页眉中的文本行格式为“日期 字符串 页码”,其中字符串两侧会插入空格,使该行填满整个页面宽度(page_width)。此处,“日期”即日期信息(详情请参阅 -D 或 --date-format 选项),“字符串”是居中显示的页眉文本,“页码”则标识当前页号。LC_MESSAGES 区域设置类别会影响“页码”部分的拼写形式;在默认的 C 区域设置下,其格式为“Page number”(其中 number 为十进制页码)。
$ cat hugo.toml
baseURL = 'https://nodeb.net/'
title = 'NodeB'
theme = 'nodeb'
paginate = 5
# 语言配置 - 使用新方式避免弃用警告
defaultContentLanguage = 'zh-cn'
[languages]
[languages.zh-cn]
label = "中文"
locale = 'zh-cn' # 替代 languageCode
direction = 'ltr' # 从左到右
weight = 1
title = 'NodeB'
[params]
mainSections = ["post"]
description = "个人博客,记录技术、生活与思考。"
author = "jqx"
featuredImage = true
# 菜单
[[menu.main]]
name = "首页"
url = "/"
weight = 1
[[menu.main]]
name = "标签"
url = "/tags/"
weight = 2
# Markdown 配置
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[minify]
minifyOutput = true
# Taxonomies
[taxonomies]
tag = "tags"
category = "categories"
series = "series"
# 输出格式
[outputs]
home = ["HTML", "RSS"]
section = ["HTML", "RSS"]
taxonomy = ["HTML", "RSS"]
term = ["HTML", "RSS"]
# 站点信息
[author]
name = "black8"
# SEO 配置
[params.seo]
enableRobots = true
# 分页配置
[pagination]
pagerSize = 5 # 等同于 paginate
$ pr hugo.toml
2026-08-19 17:23 hugo.toml Page 1
baseURL = 'https://nodeb.net/'
title = 'NodeB'
theme = 'nodeb'
paginate = 5
# 语言配置 - 使用新方式避免弃用警告
defaultContentLanguage = 'zh-cn'
[languages]
[languages.zh-cn]
label = "中文"
locale = 'zh-cn' # 替代 languageCode
direction = 'ltr' # 从左到右
weight = 1
title = 'NodeB'
[params]
mainSections = ["post"]
description = "个人博客,记录技术、生活与思考。"
author = "jqx"
featuredImage = true
# 菜单
[[menu.main]]
name = "首页"
url = "/"
weight = 1
[[menu.main]]
name = "标签"
url = "/tags/"
weight = 2
# Markdown 配置
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
[minify]
minifyOutput = true
# Taxonomies
[taxonomies]
tag = "tags"
category = "categories"
series = "series"
# 输出格式
[outputs]
home = ["HTML", "RSS"]
section = ["HTML", "RSS"]
taxonomy = ["HTML", "RSS"]
term = ["HTML", "RSS"]
# 站点信息
2026-08-19 17:23 hugo.toml Page 2
[author]
name = "black8"
# SEO 配置
[params.seo]
enableRobots = true
# 分页配置
[pagination]
pagerSize = 5 # 等同于 paginate-d输出时显示双倍行距
-D format设置页眉时间格式,默认为%Y-%m-%d %H:%M (2026-08-20 12:59)
-h header设置页眉中间的字符串,默认为文件名。
-m并行合并打印所有文件,每文件一列。
-t不打印页眉、页脚,也不填充页面底部。