Basic CommandsLesson 8Free preview
Bash Echo (echo)
This lesson is part of Bash · All levels
Summary
The echo command displays text or variable values to the screen. It is often used to print simple messages, enter text into files, and check the contents of variables. In Bash, echo -e activates the escape sequence, while the output can be switched with the > or >> mark.
Key points
- Echo text displays text followed by newline
- $VAR read the value of the variable as it expands
- e activates an escape character like newline
- > over the file and >> add at the end of the file
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.