{
    "mode": "man",
    "parameter": "expand",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/expand/1/json",
    "generated": "2026-07-05T11:44:06Z",
    "synopsis": "expand [OPTION]... [FILE]...",
    "sections": {
        "NAME": {
            "content": "expand - convert tabs to spaces\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "expand [OPTION]... [FILE]...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Convert tabs in each FILE to spaces, 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": "-i --initial",
                    "content": "do not convert tabs after non blanks\n",
                    "flag": "-i",
                    "long": "--initial"
                },
                {
                    "name": "-t --tabs",
                    "content": "have tabs N characters apart, not 8\n",
                    "flag": "-t",
                    "long": "--tabs"
                },
                {
                    "name": "-t --tabs",
                    "content": "use  comma separated list of tab positions The last specified position can be prefixed\nwith '/' to specify a tab size to use after the last explicitly  specified  tab  stop.\nAlso  a  prefix  of  '+' can be used to align remaining tab stops relative to the last\nspecified tab stop instead of the first column\n\n--help display this help and exit\n",
                    "flag": "-t",
                    "long": "--tabs"
                },
                {
                    "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": "unexpand(1)\n\nFull documentation <https://www.gnu.org/software/coreutils/expand>\nor available locally via: info '(coreutils) expand invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                   EXPAND(1)",
            "subsections": []
        }
    },
    "summary": "expand - convert tabs to spaces",
    "flags": [
        {
            "flag": "-i",
            "long": "--initial",
            "arg": null,
            "description": "do not convert tabs after non blanks"
        },
        {
            "flag": "-t",
            "long": "--tabs",
            "arg": null,
            "description": "have tabs N characters apart, not 8"
        },
        {
            "flag": "-t",
            "long": "--tabs",
            "arg": null,
            "description": "use comma separated list of tab positions The last specified position can be prefixed with '/' to specify a tab size to use after the last explicitly specified tab stop. Also a prefix of '+' can be used to align remaining tab stops relative to the last specified tab stop instead of the first column --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "unexpand",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/unexpand/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Convert tabs to spaces.",
        "examples": [
            {
                "description": "Convert tabs in each file to spaces, writing to `stdout`",
                "command": "expand {{path/to/file}}"
            },
            {
                "description": "Convert tabs to spaces, reading from `stdin`",
                "command": "expand"
            },
            {
                "description": "Do not convert tabs after non blanks",
                "command": "expand {{-i|--initial}} {{path/to/file}}"
            },
            {
                "description": "Have tabs a certain number of characters apart, not 8",
                "command": "expand {{-t|--tabs}} {{number}} {{path/to/file}}"
            },
            {
                "description": "Use a comma separated list of explicit tab positions",
                "command": "expand {{-t|--tabs}} {{1,4,6}}"
            }
        ]
    }
}