首页
首页 » 文档编辑 » fmt(fromat)

fmt(fromat)

fmt(fromat)
功能说明:编排文本文件。
语  法:fmt [-cstu][-p<列起始字符串>][-w<每列字符数>][--help][--version][文件...]
补充说明:fmt指令会从指定的文件里读取内容,将其依照指定格式重新编排后,输出到标准输出设备。若指定的文件名为"-",则fmt指令会从标准输入设备读取数据。
参  数:
  -c或--crown-margin   每段前两列缩排。
  -p<列起始字符串>或-prefix=<列起始字符串>   仅合并含有指定字符串的列,通常运用在程序语言的注解方面。
  -s或--split-only   只拆开字数超出每列字符数的列,但不合并字数不足每列字符数的列。
  -t或--tagged-paragraph   每列前两列缩排,但第1列和第2列的缩排格式不同。
  -u或--uniform-spacing   每个字符之间都以一个空格字符间隔,每个句子之间则两个空格字符分隔。
  -w<每列字符数>或--width=<每列字符数>或-<每列字符数>   设置每列的最大字符数。
  --help   在线帮助。
  --version   显示版本信息。

fmt

fmt [options] [files]

Convert text to specified width by filling lines and removing newlines. Concatenate files on the command line, or read text from standard input if - (or no file) is specified. By default, preserve blank lines, spacing, and indentation. fmt attempts to break lines at the end of sentences and to avoid breaking lines after a sentence's first word or before its last.

Options

-c,--crown-margin

Crown margin mode. Do not change indentation of each paragraph's first two lines. Use the second line's indentation as the default for subsequent lines.

-p prefix,--prefix=prefix

Format only lines beginning with prefix.

-s,--split-only

Suppress line-joining.

-t,--tagged-paragraph

Tagged paragraph mode. Same as crown mode when the indentations of the first and second lines differ. If the indentation is the same, treat the first line as its own separate paragraph.

-u,--uniform-spacing

Reduce spacing to a maximum of one space between words and two between sentences.

-w width,--width=width

Set output width to width. The default is 75.

--help

Print help message and then exit.

--version

Print version information and then exit.