O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

echo

Synopsis

echo [-eEn] [string]

Write string to standard output. (See also echo in Chapter 3.)

Options

-e

Enable interpretation of the following escape sequences, which must be quoted (or escaped with a \) to prevent interpretation by the shell:

\a

Alert (ASCII BEL).

\b

Backspace.

\c

Suppress the terminating newline (same as -n).

\e

ASCII Escape character.

\f

Formfeed.

\n

Newline.

\r

Carriage return.

\t

Tab character.

\v

Vertical-tab character.

\\

Backslash.

\0nnn

ASCII character represented by octal number nnn, where nnn is zero, one, two, or three digits and is preceded by a 0.

\nnn

ASCII character represented by octal number nnn, where nnn is one, two, or three digits.

\xHH

ASCII character represented by hexadecimal number HH, where HH is one or two hexadecimal digits.

-E

Do not interpret escape sequences, even on systems where the default behavior of the built-in echo is to interpret them.

-n

Do not print the terminating newline.

Examples

$ echo "testing printer" | lp
$ echo "Warning: ringing bell \a"

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required