echo
# Print a text message (quotes are optional)
echo "message"
# Print a message with environment variables
echo "My shell is: $SHELL"
# Print a message without the trailing newline
echo -n "message"
# Append a message to the file
echo "message" >> ππππ
# Enable interpretation of backslash escapes
# (special characters)
echo -e "Column1\tColumn2"
# Print the exit status of the last executed command
echo $?
Referencesβ
- tldr InBrowser.App. (n.d.). https://tldr.inbrowser.app/pages/common/echo
Relatedβ
- David. (2008, September 17), & Yoo. (2009, August 12). sudo echo βsomethingβ >> /etc/privilegedFile doesnβt work. Stack Overflow. https://stackoverflow.com/a/550808