{
    "mode": "man",
    "parameter": "fold",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/fold/1/json",
    "generated": "2026-06-14T07:54:49Z",
    "synopsis": "fold [OPTION]... [FILE]...",
    "sections": {
        "NAME": {
            "content": "fold - wrap each input line to fit in specified width\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "fold [OPTION]... [FILE]...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Wrap input lines in each FILE, writing to standard output.\n\nWith no FILE, or when FILE is -, read standard input.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "-b --bytes",
                    "content": "count bytes rather than columns\n",
                    "flag": "-b",
                    "long": "--bytes"
                },
                {
                    "name": "-s --spaces",
                    "content": "break at spaces\n",
                    "flag": "-s",
                    "long": "--spaces"
                },
                {
                    "name": "-w --width",
                    "content": "use WIDTH columns instead of 80\n\n--help display this help and exit\n",
                    "flag": "-w",
                    "long": "--width"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by David MacKenzie.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright  ©  2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later\n<https://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Full documentation <https://www.gnu.org/software/coreutils/fold>\nor available locally via: info '(coreutils) fold invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                     FOLD(1)",
            "subsections": []
        }
    },
    "summary": "fold - wrap each input line to fit in specified width",
    "flags": [
        {
            "flag": "-b",
            "long": "--bytes",
            "arg": null,
            "description": "count bytes rather than columns"
        },
        {
            "flag": "-s",
            "long": "--spaces",
            "arg": null,
            "description": "break at spaces"
        },
        {
            "flag": "-w",
            "long": "--width",
            "arg": null,
            "description": "use WIDTH columns instead of 80 --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Wrap each line in an input file to fit a specified width and print it to `stdout`.",
        "examples": [
            {
                "description": "Wrap each line to default width (80 characters)",
                "command": "fold {{path/to/file}}"
            },
            {
                "description": "Wrap each line to width \"30\"",
                "command": "fold -w30 {{path/to/file}}"
            },
            {
                "description": "Wrap each line to width \"5\" and break the line at spaces (puts each space separated word in a new line, words with length > 5 are wrapped)",
                "command": "fold -w5 -s {{path/to/file}}"
            }
        ]
    }
}