# How to use SSH echo command

> Canonical: https://jethost.com/kb/ssh-echo-command/ · Last modified: 2026-08-20T06:50:16+00:00

The **SSH echo command** is one of the most useful tools in a Linux environment. With it, you can print output to the SSH console, preview what a command will expand to, and check system variables before you run anything. In this tutorial, we will cover the basic usage of the SSH echo command with clear examples, so you can start using it with confidence.

## What is the SSH echo command?

In short, `echo` displays a line of text or the value of a variable in your terminal. Because it is fast and safe, it is perfect for testing. You can also use it to see how brace expansions will behave before you commit to a change. First, connect to your account over SSH, then try the examples below.

## Basic echo usage

To print plain text, simply type your message after the command. Quotes are optional for a single line:

```
echo Some text here
echo "Some text here"
```

## Output a system variable

Next, you can display the value stored in a variable. This is handy for checking your environment:

```
var='this is a variable'
echo $var
echo $USER
```

## Interpret special characters

Additionally, the `-e` flag lets the SSH echo command read special characters, such as `\n` for a new line:

```
echo -e "This is the first line \n This is the second line \n This is the third line"
```

## Preview a command before running it

Finally, you can echo a command to see its result before executing it. For example, to check how `mv` would rename your files, preview the expansion first:

```
echo mv files.{txt,pdf}
```

Because you see the output before anything changes, this simple habit helps you avoid mistakes on live files.

## Need more help?

Master different [Linux commands](https://jethost.com/kb/category/linux-commands/) with hands-on examples on a [SSH shared hosting](https://jethost.com/web-hosting/) account, or get full root control with a [JetHost VPS](https://jethost.com/vps/). Either way, you get free SSH access and full Linux terminal support, so you can run the SSH echo command directly on your server today.
