Text Processing

echo

Display a line of text or variable values to standard output.

Synopsis

syntax
echo [OPTION]... [STRING]...

Examples

Print a string
echo 'Hello, World!'
Print without trailing newline
echo -n 'no newline'
Print with escape sequences
echo -e 'line1\nline2\tindented'
Print environment variable
echo "HOME is $HOME"

Common options

FlagDescription
-nDo not append trailing newline
-eEnable interpretation of backslash escapes
-EDisable interpretation of escapes (default)

About echo

The `echo` command display a line of text or variable values to standard output. Text processing commands transform, format, and generate text output.

Linux's philosophy of small composable tools shines here — these commands are designed to be piped together to build complex text-processing workflows. They are indispensable for scripting, log analysis, and data transformation tasks.

The command accepts 3 commonly used flags shown above, though the full set of options is available in the man page (`man echo`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Text Processing Commands

Other commands in the Text Processing category

Related tools