{
    "mode": "info",
    "parameter": "expand",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/expand/json",
    "generated": "2026-11-15T13:50:47Z",
    "sections": {
        "File: coreutils.info,  Node: expand invocation,  Next: unexpand invocation,  Prev: tr invocation,  Up: Operating on characters": {
            "content": "",
            "subsections": [
                {
                    "name": "9.2 'expand': Convert tabs to spaces",
                    "content": "'expand' writes the contents of each given FILE, or standard input if\nnone are given or for a FILE of '-', to standard output, with tab\ncharacters converted to the appropriate number of spaces.  Synopsis:\n\nexpand [OPTION]... [FILE]...\n\nBy default, 'expand' converts all tabs to spaces.  It preserves\nbackspace characters in the output; they decrement the column count for\ntab calculations.  The default action is equivalent to '-t 8' (set tabs\nevery 8 columns).\n\nThe program accepts the following options.  Also see *note Common\noptions::.\n\n'-t TAB1[,TAB2]...'\n'--tabs=TAB1[,TAB2]...'\nIf only one tab stop is given, set the tabs TAB1 spaces apart\n(default is 8).  Otherwise, set the tabs at columns TAB1, TAB2, ...\n(numbered from 0), and replace any tabs beyond the last tab stop\ngiven with single spaces.  Tab stops can be separated by blanks as\nwell as by commas.\n\nAs a GNU extension the last TAB specified can be prefixed with a\n'/' to indicate a tab size to use for remaining positions.  For\nexample, '--tabs=2,4,/8' will set tab stops at position 2 and 4,\nand every multiple of 8 after that.\n\nAlso the last TAB specified can be prefixed with a '+' to indicate\na tab size to use for remaining positions, offset from the final\nexplicitly specified tab stop.  For example, to ignore the 1\ncharacter gutter present in diff output, one can specify a 1\ncharacter offset using '--tabs=1,+8', which will set tab stops at\npositions 1,9,17,...\n\nFor compatibility, GNU 'expand' also accepts the obsolete option\nsyntax, '-T1[,T2]...'.  New scripts should use '-t T1[,T2]...'\ninstead.\n\n'-i'\n'--initial'\nOnly convert initial tabs (those that precede all non-space or\nnon-tab characters) on each line to spaces.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}