{
    "mode": "info",
    "parameter": "echo",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/echo/json",
    "generated": "2026-08-06T09:42:57Z",
    "sections": {
        "File: coreutils.info,  Node: echo invocation,  Next: printf invocation,  Up: Printing text": {
            "content": "",
            "subsections": [
                {
                    "name": "15.1 'echo': Print a line of text",
                    "content": "'echo' writes each given STRING to standard output, with a space between\neach and a newline after the last one.  Synopsis:\n\necho [OPTION]... [STRING]...\n\nDue to shell aliases and built-in 'echo' functions, using an\nunadorned 'echo' interactively or in a script may get you different\nfunctionality than that described here.  Invoke it via 'env' (i.e., 'env\necho ...') to avoid interference from the shell.\n\nDue to historical and backwards compatibility reasons, certain bare\noption-like strings cannot be passed to 'echo' as non-option arguments."
                }
            ]
        },
        "It is therefore not advisable to use 'echo' for printing unknown or": {
            "content": "variable arguments.  The 'printf' command is recommended as a more\nportable and flexible replacement for tasks historically performed by\n'echo'.  *Note printf invocation::.\n\nThe program accepts the following options.  Also see *note Common\noptions::.  Options must precede operands, and the normally-special\nargument '--' has no special meaning and is treated like any other\nSTRING.\n\n'-n'\nDo not output the trailing newline.\n\n'-e'\nEnable interpretation of the following backslash-escaped characters\nin each STRING:\n\n'\\a'\nalert (bell)\n'\\b'\nbackspace\n'\\c'\nproduce no further output\n'\\e'\nescape\n'\\f'\nform feed\n'\\n'\nnewline\n'\\r'\ncarriage return\n'\\t'\nhorizontal tab\n'\\v'\nvertical tab\n'\\\\'\nbackslash\n'\\0NNN'\nthe eight-bit value that is the octal number NNN (zero to\nthree octal digits), if NNN is a nine-bit value, the ninth bit\nis ignored\n'\\NNN'\nthe eight-bit value that is the octal number NNN (one to three\noctal digits), if NNN is a nine-bit value, the ninth bit is\nignored\n'\\xHH'\nthe eight-bit value that is the hexadecimal number HH (one or\ntwo hexadecimal digits)\n\n'-E'\nDisable interpretation of backslash escapes in each STRING.  This\nis the default.  If '-e' and '-E' are both specified, the last one\ngiven takes effect.\n\nIf the 'POSIXLYCORRECT' environment variable is set, then when\n'echo''s first argument is not '-n' it outputs option-like arguments\ninstead of treating them as options.  For example, 'echo -ne hello'\noutputs '-ne hello' instead of plain 'hello'.  Also backslash escapes\nare always enabled.  Note to echo the string '-n', one of the characters\ncan be escaped in either octal or hexadecimal representation.  For\nexample, 'echo -e '\\x2dn''.\n\nPOSIX does not require support for any options, and says that the\nbehavior of 'echo' is implementation-defined if any STRING contains a\nbackslash or if the first argument is '-n'.  Portable programs should\nuse the 'printf' command instead.  *Note printf invocation::.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}