Skip to Content
gnux

-w, --width

Use WIDTH columns instead of 80.

An option of foldx.

Usage

foldx -w WIDTH [FILE]...
foldx --width=WIDTH [FILE]...

Details

ShortLongValueDefaultMeaning
-w--widthWIDTHuse WIDTH columns instead of 80

Examples

Fit text into a narrow 40-column display or receipt printer

foldx -w 40 notes.txt

Wrap a commit message body at 72 columns without breaking words

foldx -s -w 72 essay.txt

Break a one-line key or base64 blob into 64-byte lines

foldx -b -w 64 key.txt

Wrap the output of another command

catx long.log | foldx -w 100

Split a word into one character per line, to count or sort letters

echox abc | foldx -w 1

Save a wrapped copy of a draft for an email client that does not wrap

foldx -s -w 72 draft.txt > wrapped.txt

Wrap several chapter files in one go

foldx -w 72 a.txt b.txt

Check how many screen lines a note will take once wrapped

foldx -w 72 notes.txt | wcx -l

Help in the terminal

gnux help foldx --width

On this page