Linux in a Nutshell, Third Edition
by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, Stephen Figgins
Name
echo
Synopsis
echo [-n] [string]
Description
This is the /bin/echo command. echo also exists as a command built into the C shell and bash. The following character sequences have special meanings:
- \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 then exit.
- --version
Print version information and then exit.
Examples
/bin/echo "testing printer" | lp/bin/echo "TITLE\nTITLE" > file ; cat doc1 doc2 >> file/bin/echo "Warning: ringing bell \a"
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access