echo command (Windows / CMD)
What it does
Display text or control command echoing in a batch script. Searches for the echo command cmd usually need CMD syntax, practical switches, and notes on how it compares with PowerShell or Linux alternatives. This page covers syntax, common options, and copyable examples for Command Prompt.
Display text or control command echoing in a batch script.
Syntax
echo [on | off] | echo [message]
Common options
| Flag / option | Meaning |
|---|---|
| echo off | Stop displaying subsequent batch commands. |
| echo on | Resume command display. |
| echo. | Print a blank line in common CMD usage. |
| @ | Suppress echo for one batch command. |
Practical examples
Print message
echo Build complete
Writes a status line.
Quiet batch
@echo off
Hides the command itself and following commands.
Write file
echo enabled=true>app.ini
Creates or replaces app.ini.
Linux ↔ Windows equivalent
Closest match: echo (Linux / bash / sh / zsh). Write arguments and shell-expanded values to standard output.
Common mistakes
- Forgetting that `>` replaces a file while `>>` appends.
- Printing special characters such as `&` or `|` without escaping them.
Related commands
- setDisplay, create, or remove CMD environment variables.
- typeDisplay the contents of one or more text files.
- echoWrite arguments and shell-expanded values to standard output.
- grepSearch text for lines matching a pattern.
- Where-ObjectFilter pipeline objects by property values or a script block predicate.
- catConcatenate files and write their contents to standard output.
- Get-ContentRead file content or provider data as a stream of objects.
- tailPrint the end of input and optionally follow appended data.
FAQ
What does echo do in Command Prompt?
Display text or control command echoing in a batch script.
How do I run echo in CMD?
Open Command Prompt and follow `echo [on | off] | echo [message]`; quote paths containing spaces.
What is a practical echo example in CMD?
Try `echo Build complete` — Writes a status line.
Can echo be used in a batch file?
Yes. Check its exit code and escape CMD metacharacters when input is variable.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.