$echo
Print text strings or write data to files using shell redirection.
echo [OPTIONS] [STRING...]Essayer en direct dans le bac à sable interactif
Simulation côté client sans installation avec retour instantané.
Aperçu et fonctionnement
`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.
Options et drapeaux courants
| 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. |
Exemples pratiques du monde réel
echo "API_PORT=8080" > /home/user/.env && cat /home/user/.envCreates or overwrites .env with API_PORT=8080.
Commandes Linux associées
Rechercher des motifs de chaînes ou des expressions régulières dans des fichiers texte.
Concaténer et afficher le contenu des fichiers sur la sortie standard.
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.