Linux Views 3

The Linux echo command

The Linux echo command image 1

The echo command prints the given string.

It is also used to check the current shell’s environment variables.

echo [option] [string to print]

 Option Description 
 -n   Moves the cursor to the next line.
 -e   Performs the function set on the \(option). 
 Option  Description
 \a  Prints a warning sound (bell).
 \b  Backspace 
 \c  Does not print anything further.
 \n  Uses a newline character.
 \t  Horizontal tab
 \v  Vertical tab
 \\  Backslash 
 \f  Prints in form-feed form (a page break on a printer).
 \r  Carriage return [characters after the option are printed from the start of the line.]
 \0NNN  Prints the character whose ASCII CODE is NNN (octal).
 \xHH Prints the character whose ASCII CODE is HH (HEX [hexadecimal]).

Command examples

The Linux echo command image 2

Environment-variable examples

The Linux echo command image 3

-n option command examples

The Linux echo command image 4

-e option command examples

\b

The Linux echo command image 5

\c

The Linux echo command image 6

\n

The Linux echo command image 7

\t

The Linux echo command image 8

\v

The Linux echo command image 9

\\

The Linux echo command image 10

\r

The Linux echo command image 11

\0NNN

The Linux echo command image 12

\xHH

The Linux echo command image 13

Reactions

Comments 0

A nickname and a password are required. The same password edits or deletes the comment later. Comments appear after a review.

Comments appear after a review. The password is used again to edit or delete.