What does the echo command do?

Answer

echo prints text or variable values to standard output. echo "Hello World" prints the string. echo $HOME prints the HOME variable value. echo -n "text" suppresses the trailing newline. echo -e "line1\nline2" interprets escape sequences like \n (newline), \t (tab). echo * acts like ls (glob expansion). In scripts, echo is used for output, debugging, and writing to files with redirection: echo "config=true" >> config.txt. For more complex formatting, printf is more reliable and POSIX-portable.