Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

echo

v(uutils coreutils) 0.1.0

Options

-n

echo-help-no-newline

-e

echo-help-enable-escapes

-E

echo-help-disable-escapes

Examples

Print a text message. Note: Quotes are optional:

echo "{{Hello World}}"

Print a message with environment variables:

echo "{{My path is $PATH}}"

Print a message without the trailing newline:

echo -n "{{Hello World}}"

Append a message to the file:

echo "{{Hello World}}" >> {{file.txt}}

Enable interpretation of backslash escapes (special characters):

echo -e "{{Column 1\tColumn 2}}"

Print the exit status of the last executed command (Note: In Windows Command Prompt and PowerShell the equivalent commands are echo %errorlevel% and $lastexitcode respectively):

echo $?

The examples are provided by the tldr-pages project under the CC BY 4.0 License.

Please note that, as uutils is a work in progress, some examples might fail.