

{"id":111715,"date":"2023-02-03T10:00:40","date_gmt":"2023-02-03T04:30:40","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=111715"},"modified":"2023-02-03T10:14:32","modified_gmt":"2023-02-03T04:44:32","slug":"echo-command-in-linux","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/","title":{"rendered":"Echo Command in Linux"},"content":{"rendered":"<p>In this article, we will learn everything about the echo command in Linux. We will look at what the echo command is, what it is used for, a brief history of it, and the syntax and options used with the echo command. In the end, we will look into some practical examples of the echo command in the terminal of Ubuntu 20.04, So pay attention and read till the end.<\/p>\n<h3>What is the echo command?<\/h3>\n<p>As the name suggests, the echo command is a command-line-based utility in Linux-based operating systems that helps display a line of text. The echo command is most commonly used in shell programs than on the terminal.<\/p>\n<p>Different programming languages have different commands to print out a statement. For example, Python has &#8220;printf&#8221;, C programming language has &#8220;printf&#8221;, etc. Similarly, what printf is to C, echo is to Shell scripting.<\/p>\n<p>Apart from Linux distributions, the echo command is also available in operating systems like SymbOS, KolibriOS, HP MPE\/iX, ReactOS, Microsoft Windows, IBM OS\/2, Digital Research FlexOS, Acorn Computers Panos, Microwave OS-9, Zilog Z80-RIO, MetaComCo TRIPOS, TSC FLEX, Multics, Unix-like and Unix operating systems.<\/p>\n<p>In a nutshell, the echo command is used to print characters, variables or even simple lines of text on the screen.<\/p>\n<h3>A brief history of the echo command<\/h3>\n<p>The echo command first started in Multics and was later specified by Doug Mcllroy in C language as the &#8220;finger exercise&#8221; and verified to be helpful. The echo command made its very first appearance in the second version of Unix.<\/p>\n<p>Echo command later began developing escape sequences similar to C programming languages like \\n and \\t, along with the difference that the octal escape sequences were represented as the \\0ooo rather than \\ooo in C.<\/p>\n<h3>Syntax of the echo command<\/h3>\n<p>The syntax of the echo command is very simple. See for yourself:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo &lt;options&gt; &lt;text&gt;<\/pre>\n<p>Let us look at the field present in the syntax of the echo command:<\/p>\n<p><strong>1. &lt;options&gt;<\/strong><\/p>\n<p>This field takes in a range of options that specify how the echo command should function and print the output.<\/p>\n<p><strong>2. &lt;text&gt;<\/strong><\/p>\n<p>This field takes in the text that you want to print. In this field, you can specify characters, words, variables, or simple lines of text.<\/p>\n<h3>Options used with Linux echo command<\/h3>\n<p>Unlike the typical Linux fashion, where every command has a truckload of options, echo has only five options. Let us look at them:<\/p>\n<p><strong>1. -n<\/strong><\/p>\n<p>This option does not output a trailing newline.<\/p>\n<p><strong>2. -e<\/strong><\/p>\n<p>This option enables the interpretation of backslash escape sequences. We will look into these escape sequences in the next section.<\/p>\n<p><strong>3. -E<\/strong><\/p>\n<p>This option disables the interpretation of backslash escape sequences. This option is already selected by default.<\/p>\n<p><strong>4. &#8211;help<\/strong><\/p>\n<p>This option displays the help menu of the echo command.<\/p>\n<p><strong>5. &#8211;version<\/strong><\/p>\n<p>This option shows the version of the echo command you are using.<\/p>\n<h3>Escape sequences used with Linux echo command<\/h3>\n<p>We have seen that the echo command has escape sequences like &#8220;\\n&#8221; and &#8220;\\t&#8221; we have also seen that we can use such escape sequences when we pair the echo command with the option &#8220;-e&#8221; let us look at the different escape sequences and what they are used for.<\/p>\n<p><strong>1. \\\\<\/strong><\/p>\n<p>This escape sequence lets you print a literal backslash (\\) in your text.<\/p>\n<p><strong>2. \\a<\/strong><\/p>\n<p>This escape sequence gives you an alert (the BELL character).<\/p>\n<p><strong>3. \\b<\/strong><\/p>\n<p>This escape sequence stands for a backspace.<\/p>\n<p><strong>4. \\c<\/strong><\/p>\n<p>This escape sequence produces no further output after this.<\/p>\n<p><strong>5. \\e<\/strong><\/p>\n<p>This escape sequence stands for escape (Esc).<\/p>\n<p><strong>6. \\f<\/strong><\/p>\n<p>This escape sequence gives a form feed.<\/p>\n<p><strong>7. \\n<\/strong><\/p>\n<p>This escape sequence gives a new line. It means the text after this will appear in a new line and not in the same line before it.<\/p>\n<p><strong>8. \\r<\/strong><\/p>\n<p>This escape sequence gives a carriage return.<\/p>\n<p><strong>9. \\t<\/strong><\/p>\n<p>This escape sequence prints a horizontal tab (4 spaces).<\/p>\n<p><strong>10. \\v<\/strong><\/p>\n<p>This escape sequence prints a vertical tab (4 lines).<\/p>\n<p><strong>11. \\0&lt;nnn&gt;<\/strong><\/p>\n<p>This escape sequence is a byte with the octal value of the specified value &#8220;nnn&#8221;.<\/p>\n<p><strong>12. \\n&lt;hh&gt;<\/strong><\/p>\n<p>This escape sequence is a byte with the hexadecimal value specified by the user &#8220;hh.&#8221;<\/p>\n<p>Now that we have laid down the fundamentals and theory of the echo command let us look at some examples of using the echo command.<\/p>\n<h3>Printing &#8220;Hello World!&#8221;<\/h3>\n<p>It would be a shame to print anything other than the cliched &#8220;Hello World&#8221; statement to print our first text using the echo command. To do so, write the echo command followed by the text you want to print such that it is enclosed in double-quotes (&#8220;\u201d) as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/printing-hello-world.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111847\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/printing-hello-world.webp\" alt=\"printing hello world\" width=\"1073\" height=\"186\" \/><\/a><\/p>\n<h3>Using escape sequences in linux<\/h3>\n<p>We saw that to use escae sequences. First, we must use the option &#8220;-e&#8221; and only then specify these sequences in our text. Let us look at some of these sequences in action.<\/p>\n<p><strong>1. Printing a new line<\/strong><\/p>\n<p>If you want to print a text in a new line, use the escape sequence &#8220;\\n&#8221;. Use the syntax shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo -e \u201c&lt;text1&gt; \/n&lt;text2&gt;\u201d<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-a-new-line.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111848\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-a-new-line.webp\" alt=\"printing a new line\" width=\"1074\" height=\"141\" \/><\/a><\/p>\n<p><strong>2. Printing a horizontal tab<\/strong><\/p>\n<p>If you want to print a horizontal tab (4 spaces), use the escape sequence &#8220;\\t&#8221;. Use the syntax shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo -e \u201c&lt;text1&gt; \/t&lt;text2&gt;\u201d<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-a-horizontal-tab.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111850\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-a-horizontal-tab.webp\" alt=\"printing a horizontal tab\" width=\"1073\" height=\"142\" \/><\/a><\/p>\n<p><strong>3. Printing a vertical tab<\/strong><\/p>\n<p>If you want to print a vertical tab (4 lines), use the escape sequence &#8220;\\v&#8221;. Use the syntax shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo -e \u201c&lt;text1&gt; \/v&lt;text2&gt;\u201d<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-a-vertical-tab.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111849\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-a-vertical-tab.webp\" alt=\"printing a vertical tab\" width=\"1073\" height=\"141\" \/><\/a><\/p>\n<p><strong>4. Printing a backslash<\/strong><\/p>\n<p>While using the echo command, If you want to print a backslash in your text, you cannot write the backlash as it is. Why? Because the echo command will think that you are trying to write an escape sequence and print an error. Therefore to print a literal backslash, you need to use the escape sequence &#8220;\/\/&#8221; as shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo -e \u201c&lt;text1&gt; \/\/&lt;text2&gt;\u201d<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-a-backslash.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111851\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-a-backslash.webp\" alt=\"printing a backslash\" width=\"1073\" height=\"139\" \/><\/a><\/p>\n<p><strong>5. Omitting part of a string in linux<\/strong><\/p>\n<p>While using the echo command, if you want to shorten part of the string by omitting the part that follows the escape character in the output, use &#8220;\\c&#8221; as shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo -e \u201c&lt;text1&gt; \/c&lt;text2&gt;\u201d<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/omitting-part-of-a-string.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111852\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/omitting-part-of-a-string.webp\" alt=\"omitting part of a string\" width=\"1073\" height=\"123\" \/><\/a><\/p>\n<p><strong>6. Changing the colour of a string<\/strong><\/p>\n<p>We can use the ANSI escape sequences to change the colour of the output text.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/changing-the-colour-of-a-string.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111853\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/changing-the-colour-of-a-string.webp\" alt=\"changing the colour of a string\" width=\"1073\" height=\"210\" \/><\/a><\/p>\n<h3>Writing to a file in linux<\/h3>\n<p>If we want to write the text that we are printing with the echo command to a file, we can use the redirection operator (&gt;&gt;) as shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo echo \u201c&lt;text&gt;\u201d &gt;&gt; &lt;filename&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/writing-to-a-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111854\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/writing-to-a-file.webp\" alt=\"writing to a file\" width=\"1073\" height=\"166\" \/><\/a><\/p>\n<h3>Printing variables in linux<\/h3>\n<p>We can also print variables using the echo command. For example, we can directly print the predefined environment variables as shown:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-variables.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111855\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-variables.webp\" alt=\"printing variables\" width=\"1073\" height=\"153\" \/><\/a><\/p>\n<p>Or we ourselves can assign a variable and then print it as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-variables-by-assigning-them.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111856\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-variables-by-assigning-them.webp\" alt=\"printing variables by assigning them\" width=\"1073\" height=\"126\" \/><\/a><\/p>\n<h3>Displaying the output of other commands in linux<\/h3>\n<p>We can also print the output of other commands using the echo command, but why would you do that? Well, we can print a custom message before the command output, as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/displaying-the-output-of-other-commands.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111857\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/displaying-the-output-of-other-commands.webp\" alt=\"displaying the output of other commands\" width=\"1073\" height=\"150\" \/><\/a><\/p>\n<p>Here is another example:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/example-of-displaying-the-output-of-other-commands.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111858\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/example-of-displaying-the-output-of-other-commands.webp\" alt=\"example of displaying the output of other commands\" width=\"1936\" height=\"2096\" \/><\/a><\/p>\n<h3>Listing contents of the present directory using the echo command<\/h3>\n<p>We all know that we list the contents of a specific directory using the &#8220;ls&#8221; command. What if I tell you you could also do the same with the echo command? You can use the command &#8220;echo *&#8221; to print all the contents (directories and files) in the current directory.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/listing-contents-of-the-present-directory-using-the-echo-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111860\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/listing-contents-of-the-present-directory-using-the-echo-command.webp\" alt=\"listing contents of the present directory using the echo command\" width=\"626\" height=\"110\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Similarly, you can also list only specific types of files by specifying the type after the wildcard (*) as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/listing-contents-of-the-present-directory-using-the-echo-command-using-the-wildcard-symbol.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111859\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/listing-contents-of-the-present-directory-using-the-echo-command-using-the-wildcard-symbol.webp\" alt=\"listing contents of the present directory using the echo command using the wildcard symbol\" width=\"1166\" height=\"132\" \/><\/a><\/p>\n<h3>Combining escape sequences in linux<\/h3>\n<p>You can combine two or more escape sequences as you like. There is truly no limit! Let us look at one such example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo -e \"\\n\\t&lt;text1&gt;\\n\\t&lt;text2&gt;\"<\/pre>\n<h3>Backspace in the echo command<\/h3>\n<p>If you want to use the backspace in your text in the echo command, use the escape sequence &#8220;\/b&#8221; as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/backspace-in-the-echo-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111861\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/backspace-in-the-echo-command.webp\" alt=\"backspace in the echo command\" width=\"1073\" height=\"144\" \/><\/a><\/p>\n<h3>Omit trailing new line<\/h3>\n<p>If you don\u2019t want a new line then pair the echo command with the option \u201c-n\u201d as shown:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo -n &lt;text&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/omit-trailing-new-line.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111862\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/omit-trailing-new-line.webp\" alt=\"omit trailing new line\" width=\"1073\" height=\"78\" \/><\/a><\/p>\n<h3>Printing the version of the echo command<\/h3>\n<p>If you want to print the information regarding the echo command you are using in your system, type the command &#8220;\/bin\/echo &#8211;version&#8221; in the terminal as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-the-version-of-the-echo-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111863\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-the-version-of-the-echo-command.webp\" alt=\"printing the version of the echo command\" width=\"1073\" height=\"219\" \/><\/a><\/p>\n<h3>Printing the help menu of the echo command<\/h3>\n<p>If you want to print the help menu of the echo command, which contains the usage and information about the options and escape characters, type the command &#8220;\/bin\/echo &#8211;help&#8221; in the terminal as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-the-help-menu-of-the-echo-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111864\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/02\/printing-the-help-menu-of-the-echo-command.webp\" alt=\"printing the help menu of the echo command\" width=\"1073\" height=\"460\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>As you have seen, the echo command is a simple tool to print text on the screen. You have now learned what echo is, why it is used, the syntax, options, and escape sequences of the echo command with a few examples.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will learn everything about the echo command in Linux. We will look at what the echo command is, what it is used for, a brief history of it, and the&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":111808,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[27218],"class_list":["post-111715","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-echo-command-in-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Echo Command in Linux - DataFlair<\/title>\n<meta name=\"description\" content=\"Linux echo command is a simple tool to print text on the screen. See its syntax, options, and escape sequences with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Echo Command in Linux - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Linux echo command is a simple tool to print text on the screen. See its syntax, options, and escape sequences with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-03T04:30:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-03T04:44:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/linux-echo-command.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Echo Command in Linux - DataFlair","description":"Linux echo command is a simple tool to print text on the screen. See its syntax, options, and escape sequences with examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"Echo Command in Linux - DataFlair","og_description":"Linux echo command is a simple tool to print text on the screen. See its syntax, options, and escape sequences with examples.","og_url":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-02-03T04:30:40+00:00","article_modified_time":"2023-02-03T04:44:32+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/linux-echo-command.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Echo Command in Linux","datePublished":"2023-02-03T04:30:40+00:00","dateModified":"2023-02-03T04:44:32+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/"},"wordCount":1388,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/linux-echo-command.webp","keywords":["Echo Command in Linux"],"articleSection":["Linux Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/","url":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/","name":"Echo Command in Linux - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/linux-echo-command.webp","datePublished":"2023-02-03T04:30:40+00:00","dateModified":"2023-02-03T04:44:32+00:00","description":"Linux echo command is a simple tool to print text on the screen. See its syntax, options, and escape sequences with examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/linux-echo-command.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/01\/linux-echo-command.webp","width":1200,"height":628,"caption":"linux echo command"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/echo-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Linux Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/linux\/"},{"@type":"ListItem","position":3,"name":"Echo Command in Linux"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/111715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=111715"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/111715\/revisions"}],"predecessor-version":[{"id":111865,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/111715\/revisions\/111865"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/111808"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=111715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=111715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=111715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}