Command Line Basics: echo

May 13, 2009 by
Filed under: bash, command line, linux 

I'm starting a new feature called Command Line Basics. In this first installment I'm going to cover the echo command.

The echo command is used for sending text to the standard output. In most cases, the standard output is your terminal. For example, to print the word "echo" to your terminal output, enter the command

echo echo

Now, echo can take multiple words as input, so if you want to print a line of text, just enter your line of text after the echo command.

echo This is a line of text output from the echo command.

You may be asking yourself at this point, "Why would I ever want to do that?" Well, this can come in handy for printing output from script programs. If you've ever done BASIC programming, it's like a print statement.

Affiliate Link

I'll cover its usage in scripts in a new feature called Bash to Basics.

Comments

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>