Beginner Package: coreutils / bash builtin

echo

Print text or the value of a variable.

Syntax

echo [options] text

Description

echo prints its arguments to the screen, and is used constantly both interactively and in scripts โ€” commonly to display a variable's value or write a simple line of text into a file.

Examples

echo "Hello, world"
Print a line of text
echo $HOME
Print the value of an environment variable
echo "export PATH=$PATH:/opt/bin" >> ~/.bashrc
Append a line to a config file

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux