把 man 手册导出为文档在「预览」中阅读
将命令手册排版后直接送入「预览」打开,可缩放、搜索、打印。
运行 man -t rsync | open -f -a Preview,即可在预览中查看 rsync 手册;替换任意命令名均可。
01命令
命令
$ man -t rsync | open -f -a Preview02作用说明
man -t 会把手册页排版成可打印的 PostScript/PDF 流,open -f 则把这份标准输入内容交给「预览」显示成分页文档。它对系统里每个 man 手册都有效,还能直接在预览中打印或另存,比终端里的等宽字体友好得多。
03风险
!注意: 文档是即时生成的,请把整条管道写在一行;长手册可能有很多页,macOS 默认自带所需排版工具。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- man - Format and Display the On-line Manual Pages依据: Documents the -t option which formats the manual page with troff/groff for printing (output on stdout).
- open - Open Files, Directories and Applications依据: Documents open -f, which reads input from stdin and opens it with the specified application (-a Preview).
最后验证: 2026-09-19 · 分类: 文件与文件夹