Skip to content

echo

Used to display text passed in as arguments.

Terminal window
# Interpret the escape characters too
echo -e "Hello\tWorld\n"
# Appending text to a file
echo "Hello world" >> test.txt
# Overwriting text from the file
echo "Hello world" > test.txt
# Display variables
name="world"
echo "Hello $name"
OptionsDescription
-nhelps remove trailing newline characters
-eenable interpretations of escape characters

NA