FOLD(1)
π fold(1) β wrap each input line to fit specified width π
β¨ NAME β¨
okay so bestie, this is fold β the little Unix icon that wraps each input line to fit a specified width. slay. π
π¦ SYNOPSIS π¦
fold [-bs] [-w width] [file ...]
πΈ DESCRIPTION πΈ
fold reads lines from the files you give it β or from standard input if you donβt give it any files β and writes them to standard output, inserting newlines into lines that are longer than the specified column width. no cap, thatβs the whole main character energy. β¨
The default column width is 80, but you can override it with the -w flag. For historical reasons, you can also specify the width directly, like fold -72, omitting the -w. iykyk. π«Ά
-w widthβ sets the column width; default is80. and yes,fold -72is the historical direct-width move where you skip-wentirely.-sβ makes breaks happen after whitespace instead of in the middle of a word. itβs giving ragged right edge, but honestly itβs much nicer to look at. π-bβ makes the program ignore embedded backspaces, tabs, and carriage returns when deciding where to split. this makes it run about thirty times faster, so you might want to get used to using-b. literally iconic. π₯
Current locale settings will be honored in determining what is meant by βwhitespaceβ and βword charactersβ. π
π BUGS π
POSIX 1003.2 states that a newline will never be inserted immediately before or after a backspace or a carriage return, but this is not checked for. so likeβ¦ noted, bestie. π
π SEE ALSO π
π AUTHORS π
Clinton Pierce and Tom Christiansen.
This code is freely modifiable and freely redistributable under Perlβs Artistic License. periodt. π
xoxo bestie π β this page is from perl v5.42.2, dated 2026-02-15, and itβs the FOLD(1) page. π«Ά
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms