- Source: Fold (Unix)
fold is a Unix command used for making a file with long lines more readable on a limited width computer terminal by performing a line wrap.
Most Unix terminals have a default screen width of 80, and therefore reading files with long lines could get annoying. The fold command puts a line feed every X characters if it does not reach a new line before that point. If the -w argument is set, the fold command allows the user to set the maximum length of a line.
History
The utility first appeared in 1BSD of 1977 and was originally written by Bill Joy.
fold is part of the X/Open Portability Guide since issue 4 of 1992. It was inherited into the first version of POSIX.1 and the Single Unix Specification.
The version of fold bundled in GNU coreutils was written by David MacKenzie.
The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.
Example
As a usage example, to fold a file named file.txt to have a maximum of 50 characters per line, one could run the following command:
See also
coreutils
fmt (Unix)
Par (command)
List of Unix commands
Text mode § PC common text modes
References
External links
fold(1) – OpenBSD General Commands Manual
fold(1) – FreeBSD General Commands Manual
Kata Kunci Pencarian:
- Daftar perintah Unix
- One UI
- Ponsel cerdas
- CalyxOS
- Fold (Unix)
- Folding
- Unix
- List of POSIX commands
- Shell script
- Filter (software)
- Unix System Laboratories
- Xargs
- Case sensitivity
- 88open