1D1C - echo

Photo by Caleb Steele on Unsplash

1D1C - echo

display a line of text

Syed Jafer K's photo
Syed Jafer K
·Sep 17, 2022·

1 min read

Subscribe to our newsletter and never miss any upcoming articles

Play this article

echo - display a line of text.

1. $ echo "Welcome to Linux"

image.png

2. To enable the interpretation of backslash escapes -e option \b To removes all the spaces in between the text

$ echo -e "Welcome \bto \bLinux"

image.png

3. \c To suppress trailing new line with backspace interpretor ‘-e‘ to continue without emitting new line.

$ echo -e "Welcome \cto Linux"

image.png

4. \n To create new line from where it is used.

$ echo -e "Welcome \nto \nLinux"

image.png

5. \t To create horizontal tab spaces

$ echo -e "Welcome \tto \tLinux"

image.png

6. \r To carriage return with backspace interpretor ‘-e‘ to have specified carriage return in output

$ echo -e "Welcome \rto Linux"

image.png

7. \v To create vertical tab spaces

$ echo -e "Welcome \vto \vLinux"

image.png

8. To print all files/folders

$ echo *

image.png

 
Share this