$echo
Print text strings or write data to files using shell redirection.
echo [OPTIONS] [STRING...]Prueba en vivo en la terminal interactiva
Simulación del lado del cliente sin instalación y con respuesta inmediata.
Descripción general y funcionamiento
`echo` displays strings of text to standard output. When paired with `>` (overwrite) or `>>` (append) redirection operators, `echo` is the most common way to create config files, append environment variables, or print script debug statuses.
Opciones y banderas comunes
| Flag / Option | Description |
|---|---|
| -e | Enable interpretation of backslash escapes (e.g., \n for newline, \t for tab). |
| -n | Do not output the trailing newline character. |
Ejemplos prácticos del mundo real
echo "API_PORT=8080" > /home/user/.env && cat /home/user/.envCreates or overwrites .env with API_PORT=8080.
Comandos de Linux relacionados
Busque patrones de cadenas o expresiones regulares dentro de archivos de texto.
Concatene e imprima el contenido de archivos en la salida estándar.
Create empty files or update file access and modification timestamps.
Output the first part (top lines) of text files.
Output the last part (bottom lines) of files or stream real-time logs.
Print newline, word, and byte counts for files.