Linux ECHO Command


 

Usage of Linux ECHO Command:

This command is very important command widely used in bash and c shells. It is used to display a line of text/string on standard output or a console.

Syntax:

Example1 : Input a line “Hi, this is my session 2” and display on standard output.

pic1

Example2 : Declare a variable x and assign its value let’s say 30. Then, echo its value i.e. print value of x.

pic2

Example3 : Print statement “ I Love Linux” with no space using echo.

Explanation: Usage of \b as backslash interpreter.

pic4

Example4 : Print all words of a string keeping one word in each line. Lets take string as “I Love Linux”.

Explanation: \n is used as next line interpreter.

pic5

Example5 : Print all files and folder in current path using echo command (an alternative of ls command).

 


 






Leave a Reply