# man > echo

---
type: CommandReference
command: echo
mode: man
section: "1"
source: man-pages
---

## Quick Reference
- `echo "Hello World"` — Print a text message.
- `echo "My path is $PATH"` — Print a message with environment variables.
- `echo -n "Hello World"` — Print a message without trailing newline.
- `echo "Hello World" >> file.txt` — Append a message to a file.
- `echo -e "Column 1\tColumn 2"` — Enable interpretation of backslash escapes.
- `echo $?` — Print exit status of last command.
- `echo "Hello World" | program` — Pass text to another program via stdin.

## Name
echo - display a line of text

## Synopsis
`echo` [*SHORT-OPTION*]... [*STRING*]...
`echo` *LONG-OPTION*

Note: Your shell may have its own version of echo, which usually supersedes the version described here. Refer to your shell's documentation for details.

## Options
- `-n` — Do not output the trailing newline.
- `-e` — Enable interpretation of backslash escape sequences.
- `-E` — Disable interpretation of backslash escape sequences (default).
- `--help` — Display help and exit.
- `--version` — Output version information and exit.

Escape sequences (when `-e` is active):
- `\\` — backslash
- `\a` — alert (BEL)
- `\b` — backspace
- `\c` — produce no further output
- `\e` — escape
- `\f` — form feed
- `\n` — new line
- `\r` — carriage return
- `\t` — horizontal tab
- `\v` — vertical tab
- `\0NNN` — byte with octal value NNN (1 to 3 digits)
- `\xHH` — byte with hexadecimal value HH (1 to 2 digits)

## Examples
shell
echo "Hello World"
echo -n "No newline"
echo -e "Tab\tseparated"
echo "Append" >> file.txt
echo $?
echo "Pipe" | grep Pipe
## See Also
- [GNU coreutils echo documentation](https://www.gnu.org/software/coreutils/echo)