TrumanWong

fold

Control the screen width occupied by file content when output

Supplementary instructions

fold command is used to control the screen width occupied when the file content is output. The fold command will read the content from the specified file, add column extension characters to the columns that exceed the limited column width, and then output it to the standard output device. If no file name is specified, or the file name given is "-", the fold command reads data from the standard input device.

grammar

fold(option)(parameter)

Options

-b or --bytes: Calculate column width in Byte instead of row number;
-s or --spaces: Use space characters as column breaks;
-w <number of rows per column> or --width <number of rows per column>: Set the maximum number of rows per column.

Parameters

File: Specify the file whose content you want to display.

Example

fold -w 5 filename