Skip to Content
gnux

-w, --width

Maximum line width (default of 75 columns).

An option of fmtx.

Usage

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

Details

ShortLongValueDefaultMeaning
-w--widthWIDTHmaximum line width (default of 75 columns)

Examples

Rewrap a commit message to the 72 columns git log expects

fmtx -w 72 message.txt

Shorten overlong lines in a script or list without merging its lines

fmtx -s -w 80 script.txt

Reflow a block of shell comments after editing them

fmtx -p '#' -w 72 config.sh

Aim for even 70-column lines, never exceeding 80

fmtx -w 80 -g 70 notes.txt

Reflow text coming out of another command

catx a.txt b.txt | fmtx -w 66

Save a cleanly wrapped final copy of a draft

fmtx -w 72 draft.txt > final.txt

Help in the terminal

gnux help fmtx --width

On this page