in

Echo Linux- 50 Best Echo Commands with Examples[Simple Steps]

Echo Linux

Echo Linux: In this article, we will see, What is an Echo Command in Linux and what is its purpose and examples of using Echo command with different functionalities which are attained by adding Short options, Long options and more. Echo is the Basic and a Built-in Command which we can find in almost all Operating systems like Linux, Unix, Windows and more. Echo can perform certain predefined tasks when they are instructed. As stated above, echo[Echo Linux] is also used widely on Linux based operating terms such as Linux Ubuntu Unity 18.04.1 LTS and more.

Jump To:

What is Echo in Computer Environment?

  • Echo is a Built-in Command developed for C Shells and Linux Bash which helps the user to batch files to display a line of text(s)/String(s) on a Standard output or on a file.
  • Echo Command is widely used on Unix Based Operating systems and since Linux is also a Unix based Operating systems, there are a lot of functions or tasks that an echo command on Linux can perform on Linux based operating systems such as Ubuntu, Mint and more.

The syntax of Echo Command:

The following is the general syntax of Echo Command.

$   echo [option(s)] [String(s)]$   echo [Short option] …. [String]$   echo [Long option]

Table for the Usage of Echo Command:

The following table gives a piece of quick information on Echo Command usage and the various Tags and Options available. If you want a Detailed Explanation about each tag and operators then kindly refer the detailed article just below the table.

TagUsages
-eThis option enables the interpretation of Backslash Escape Sequences
-EThis option disables the interpretation of backslash escape sequences
\aBell Character. An Alert return
\nAdding a new line to your texts
\tAdding Horizontal tab spaces into your texts
\vAdding Vertical tab spaces into your texts
\cStops displaying output from this point
\rThis option is nothing but a Carriage Return.
\\Represents a Backslash(“\”)
\bPerforms a Backspace function at the defined point
\fAdding a Form Feed into your texts
Check this too  DU Command in Linux- How to Use DU on Linux Ubuntu 18.04 LTS/ 19.10

Usage of Echo Command on Linux Ubuntu Unity 18.04.1 LTS- With Examples:

In this section, we will see about the tasks the echo can perform on Linux when they are instructed. We have explained with Step by Step Image explanation for the easy understanding of the users.

If you want to have Quick look on Usage of echo commands, Refer Echo Command Usages Table.

Displaying Texts on Output(Terminal):

If you want to display a text or a line of text on Linux Terminal then you have to use the following command.

echo “your text”

Example: echo Hello World

How to Use? Type your text prefixed with echo and press Enter key.

echo linux
Displaying Texts on Output using echo

Introducing New Line for Texts:

When you are displaying a line of texts and if you wish to display them in one by one line then kindly use the following command. “-e” enables the interpretation of Backslash Escape Sequences and “\n” adds a new line.

$   echo -e “string1 \nstring2 \nstring3”

Example: echo -e “Hello World. \nWelcome to TecRust. \nTecRobust is all about Linux.”

Echo Linux
Displaying texts one by one

Adding Horizontal Tabs to the Texts:

This is similar to using tab option between your texts. This option gives out Horizontal Spaces between your texts. “-e” enables the interpretation of Backlash Escape Sequences and “\t” adds the Horizontal tab between your texts.

echo -e “String1 \tString2 \tString3”

Example: echo -e “TecRobust  \tis \tabout \tLinux”

Echo Linux
Adding Horizontal Tabs

Adding Vertical Tabs to your Texts:

This is similar to using tab option between your texts but a vertical tab. This option gives out Vertical Spaces between your texts. “-e” enables the interpretation of Backlash Escape Sequences and “\v” adds the vertical between your texts.

$   echo -e “String1 \vString2 \vString3”

Check this too  Virtual Machine for Ubuntu- How to Install Virtual Box and use Ubuntu 18.04 LTS on It

Example: echo -e “Artificial \vIntelligence \vis \vthe \vFuture”

Echo Linux
Adding Vertical Tabs to your Texts

Adding Form Feeds into your Texts:

A form feed is nothing but displaying the output from the same point on the next line. If you take a look at the example then you will have an easy understanding.

$   echo -e “String1 String2 String3 \fString4 String5”

Example: $   echo -e “TecRobust is the Lastest \fPortal for Linux”

Echo Linux
Form Feed

How to Use Backspace in your Texts:

“\b” is used to insert a backspace into your texts. It has to be used along with “-e” which enables the interpretation of Backslash Escape sequences. Kindly refer the following example.

$   echo -e “String1 String2 String3 \bString4”

Example: $   echo -e “This article is about Echo \bLinux”

Echo Linux
Inserting a Backspace into your texts

Adding Alert(Bell Character) Return to your Texts:

This is really an interesting one. We can able to make an alert using this “\a”. We need to add “-e” which is the interpretation of Backslash Sequences. Adding this in your texts is really simple. Kindly check out the following example and refer the following image for easy understanding.

echo -e “String1 \aString2”

Example: echo -e “TecRobust Welcomes \aYou”

Echo Linux
Adding an Alert to your Text

Ignoring your Texts after certain extent on Output:

This can be best explained with an example. Suppose you have written a full paragraph on the terminal but later u don’t want to display everything that you have typed on the paragraph. In this case, adding “\c” will stop displaying output after it. It has to be used along with “-e”.

$   echo -e “String1 String2 String3 \cString4 String5”

Check this too  fping- Best Ping tool for Linux & its Installation on Ubuntu

Example:$   echo -e “Welcome to the World of Artificial Intelligence. \cHello World is the most used AI Term”

Echo Linux
Ignoring Texts on the Output display

Adding Carriage Return to your Texts:

Most of us know very well about Carriage Return. It is nothing but similar to moving to the next line in a typewriter. You can add the carriage return using the tag “\r” and along with “-e” that interprets that Backslash Sequences.

$   echo -e “String1 String2 \rString3”

Example: $   echo -e “TecRobust is \ra Hub for Linux”

Echo Linux
Adding Carriage Return to your Texts

Declaring Values to a Variable using Echo Command:

You can also declare a variable and assign values and display the value on standard output using the echo command.

$   t=value

$   echo the value of the variable t=$t

Example: $   t=3

$   echo The Value of the Variable t=$t

Echo Linux
Assigning Value to a Variable

Get in Touch with Us:

This article provides detailed information on What is an Echo and How it is used in Linux based operating systems and the various usages of Echo Command on Linux based operating systems(Shell Script) such as Linux Ubuntu Unity 18.04.1 LTS and more. If you have any Query then Kindly Comment us and we will revert to you with a solution.

Article Review
  • Article Quality
  • Content Depth
  • Explanation
  • Working Efficiency
4.8

Summary

For more interesting articles on Linux, kindly visit TECROBUST

One Comment

Leave a Reply
  1. Hi there, I discovered your site by means of Google while searching for a similar topic,
    your website came up, it looks good. I have bookmarked it in my google bookmarks.

    Hi there, just was aware of your blog thru Google, and found that it is truly informative.
    I’m gonna be careful with Brussels. I will appreciate if you happen to proceed this in future. A lot of folks will probably be benefited from your writing. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *

Written by Ranger

Hey Guys, How you doing? I am Ranger and I am from Philadelphia. Actually, I am a very Lazy person with an active mind and a lazy body and mostly sleeping because of that. Foods and Places are my favorite and I would love to explore places. Contact me through the Contact Us page adding "@Ranger" on the Subject.

Error 0xc00000a5

Error 0xc00000a5 Google Chrome Easy Fix !! How To Methods:

gping Linux

gping- Install gping Linux on Ubuntu Unity & other Debian Distros