Files
tldr/pages.zh/common/fmt.md

20 lines
590 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# fmt
> 通过将段落连接在一起并将行宽限制为一定字符数默认75个字符来重新格式化文本文件。
> 更多信息:<https://www.gnu.org/software/coreutils/fmt>。
- 重新格式化文件:
`fmt {{路径/到/文件}}`
- 重新格式化文件,输出行最多为 `n` 个字符:
`fmt -w {{n}} {{路径/到/文件}}`
- 重新格式化文件,不将短于给定宽度的行连接在一起:
`fmt -s {{路径/到/文件}}`
- 以统一间距重新格式化文件单词之间1个空格段落之间2个空格
`fmt -u {{路径/到/文件}}`