cmdxray / commands / fold

What does fold do?

wrap each input line to a given width.

▸ Explain your own fold command →

fold examples, explained

$ fold -w 72 -s letter.txt

  • foldwrap each input line to a given width
  • -wset the maximum line width (default 80 columns)
  • 72value for -w
  • -sbreak at spaces so words are not split
  • letter.txtan argument passed to the command

$ fold -w 40 notes.txt

  • foldwrap each input line to a given width
  • -wset the maximum line width (default 80 columns)
  • 40value for -w
  • notes.txtan argument passed to the command

fold flags & options

-wset the maximum line width (default 80 columns)
-sbreak at spaces so words are not split
-bcount bytes rather than display columns
--widthset the maximum line width
--spacesbreak at spaces so words are not split
--bytescount bytes rather than display columns

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.