{
    "mode": "man",
    "parameter": "wc",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/wc/1/json",
    "generated": "2026-06-03T00:20:39Z",
    "synopsis": "wc [OPTION]... [FILE]...\nwc [OPTION]... --files0-from=F",
    "sections": {
        "NAME": {
            "content": "wc - print newline, word, and byte counts for each file\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "wc [OPTION]... [FILE]...\nwc [OPTION]... --files0-from=F\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is\nspecified.  A word is a non-zero-length sequence of characters delimited by white space.\n\nWith no FILE, or when FILE is -, read standard input.\n\nThe options below may be used to select which counts are printed, always in the following or‐\nder: newline, word, character, byte, maximum line length.\n",
            "subsections": [
                {
                    "name": "-c --bytes",
                    "content": "print the byte counts\n",
                    "flag": "-c",
                    "long": "--bytes"
                },
                {
                    "name": "-m --chars",
                    "content": "print the character counts\n",
                    "flag": "-m",
                    "long": "--chars"
                },
                {
                    "name": "-l --lines",
                    "content": "print the newline counts\n\n--files0-from=F\nread  input from the files specified by NUL-terminated names in file F; If F is - then\nread names from standard input\n",
                    "flag": "-l",
                    "long": "--lines"
                },
                {
                    "name": "-L --max-line-length",
                    "content": "print the maximum display width\n",
                    "flag": "-L",
                    "long": "--max-line-length"
                },
                {
                    "name": "-w --words",
                    "content": "print the word counts\n\n--help display this help and exit\n",
                    "flag": "-w",
                    "long": "--words"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Paul Rubin and 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/wc>\nor available locally via: info '(coreutils) wc invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                       WC(1)",
            "subsections": []
        }
    },
    "summary": "wc - print newline, word, and byte counts for each file",
    "flags": [
        {
            "flag": "-c",
            "long": "--bytes",
            "arg": null,
            "description": "print the byte counts"
        },
        {
            "flag": "-m",
            "long": "--chars",
            "arg": null,
            "description": "print the character counts"
        },
        {
            "flag": "-l",
            "long": "--lines",
            "arg": null,
            "description": "print the newline counts --files0-from=F read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input"
        },
        {
            "flag": "-L",
            "long": "--max-line-length",
            "arg": null,
            "description": "print the maximum display width"
        },
        {
            "flag": "-w",
            "long": "--words",
            "arg": null,
            "description": "print the word counts --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Count lines, words, and bytes.",
        "examples": [
            {
                "description": "Count all lines in a file",
                "command": "wc {{-l|--lines}} {{path/to/file}}"
            },
            {
                "description": "Count all words in a file",
                "command": "wc {{-w|--words}} {{path/to/file}}"
            },
            {
                "description": "Count all bytes in a file",
                "command": "wc {{-c|--bytes}} {{path/to/file}}"
            },
            {
                "description": "Count all characters in a file (taking multi-byte characters into account)",
                "command": "wc {{-m|--chars}} {{path/to/file}}"
            },
            {
                "description": "Count all lines, words, and bytes from `stdin`",
                "command": "{{find .}} | wc"
            },
            {
                "description": "Count the length of the longest line in number of characters",
                "command": "wc {{-L|--max-line-length}} {{path/to/file}}"
            }
        ]
    }
}