echo

Print given arguments. More information: <https://www.gnu.org/software/coreutils/echo>.

Install

All systems
curl cmd.cat/echo.sh
Debian Debian
apt-get install coreutils
Ubuntu
apt-get install coreutils
Alpine
apk add coreutils
Arch Arch Linux
pacman -S coreutils
image/svg+xml Kali Linux
apt-get install coreutils
CentOS
yum install coreutils
Fedora
dnf install coreutils
Windows (WSL2)
sudo apt-get update sudo apt-get install coreutils
OS X
brew install coreutils
Raspbian
apt-get install coreutils
Docker
docker run cmd.cat/echo echo powered by Commando

Print given arguments. More information: <https://www.gnu.org/software/coreutils/echo>.

  • 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 $?

© tl;dr; authors and contributors