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 [options] [string]

Send (echo) the input string to standard output. This is the /bin/echo command. echo also exists as a command built into bash. You may have to specify the full path to run /bin/echo instead of the shell built-in command. The following character sequences have special meaning:

\a

Alert (bell).

\b

Backspace.

\c

Suppress trailing newline.

\f

Form feed.

\n

Newline.

\r

Carriage return.

\t

Horizontal tab.

\v

Vertical tab.

\\

Literal backslash.

\nnn

The octal character whose ASCII code is nnn.

Options

-e

Enable character sequences with special meaning. (In some versions, this option is not required in order to make the sequences work.)

-E

Disable character sequences with special meaning.

-n

Suppress printing of newline after text.

--help

Print help message and exit.

--version

Print version information and exit.

Examples

/bin/echo "testing printer" | lp
/bin/echo "TITLE" > file ; cat doc1 doc2 >> file
/bin/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