Junior — Middle
What is the purpose of the echo command in Linux?
sobes.tech AI
Answer from AI
The echo command in Linux is used to output text or variable values to standard output (usually the terminal). It is often used for displaying messages, creating simple text files, or passing data to other commands via a pipeline.
Example:
echo "Hello, world!"
This will display the string "Hello, world!" in the terminal.
echo is also useful for displaying variable values:
NAME="Ivan"
echo "Hello, $NAME"
Result: "Hello, Ivan".