echo Command

Display a line of text.
Echo the STRING(s) to standard output

Basic Usage:
echo text

Examples:
echo hello boys
hello boys


echo "hello boys"
hello boys
If you forget to close " sign:), you can continue to give output. When you close " sign, you can see echo command's output on screen. You can send output to a file if you wish.

echo İşlem tamam > abc.txt
This command makes a new abc.txt file if there isn't. If there is abc.txt file, it removes old content and writes new content.

echo İşlem tamam2 >> abc.txt
This command makes a new abc.txt file if there isn't. If there is abc.txt file, it adds content to this file's old content.

echo {1,2,3,par}dus
1dus 2dus 3dus pardus


echo {1,2,3}defa;echo pardus
1defa 2defa 3defa
pardus


echo $((4+2))
6

echo $((4-2))
2

echo $((9*2))
18

echo $((14/2))
7
echo $((14/2*3+7))
28


echo -e merhaba '\n'selam
merhaba
selam
You can use '\n' and other characters with -e parameter. '\n' is new line

echo -e '\0111'
I
The character whose ASCII code is NNN (octal) (for \0NNN). NNN can be 0 to 3 octal digits


echo -e '\0155'
m


echo -e '\x23'
#
The eight-bit character whose value is HH (hexadecimal) (for \xHH). HH can be one or two hex digits

help echo
Display help page.


/bin/echo --version
Display version info.


Above process applied on "GNU bash, version 4.3.11(1)-release (i686-pc-linux-gnu)"
Date of Article: 05.03.2016




HOME GNU/LINUX Commands TURKISH