fold
rose1 发表于 2020-09-16 17:28浏览次数:
在类似Unix的操作系统上,fold命令将输入文本的每一行换行以适合指定的行宽。
本文档介绍fold的GNU / Linux版本。
On Unix-like operating systems, the fold command wraps each line of input text to fit a specified line width.
This document covers the GNU/Linux version of fold.
目录:
1 fold 运行系统环境
2 fold 语法
3 fold 例子
fold 运行系统环境
fold 语法
fold [OPTION]... [FILE]...
选件
|
-b, --bytes
|
计算字节数而不是列数。
|
|
-s, --spaces
|
在空格处休息。
|
|
-n, -wn, --width=n
|
使用n列,而不是默认值80。
|
|
--help
|
显示帮助消息并退出。
|
|
--version
|
显示版本信息并退出。
|
如果未指定FILE,则从标准输入fold读取。
fold [OPTION]... [FILE]...
Options
|
-b, --bytes
|
count bytes rather than columns.
|
|
-s, --spaces
|
break at spaces.
|
|
-n, -wn, --width=n
|
use n columns instead of the default of 80.
|
|
--help
|
Display a help message and exit.
|
|
--version
|
Display version information and exit.
|
If no FILE is specified, fold reads from standard input.
fold 例子
fold -w5 myfile.txt > newfile.txt
将myfile.txt的行换成5个字符的宽度,然后将输出写入newfile.txt。
fold -w5 myfile.txt > newfile.txt
Wraps the lines of myfile.txt to a width of 5 characters, and writes the output to newfile.txt.