Echo ( command ) - wikipedia Echo ( command ) In computing, echo is a command in DOS, OS / 2, Microsoft Windows, Unix and Unix - like operating systems that outputs the strings it is being passed as arguments. It is a command typically used in shell scripts and batch files to output status text to the screen or a file, or as a source part of a pipeline. Many shells, including all Bourne - like ( such as Bash or zsh, ) and Csh - like shells implement echo as a builtin command. Contents 1 History 2 Usage example 3 See also 4 References 5 External links History echo began within Multics, and became part of Version 2 Unix. echo - n in Version 7 replaced prompt, ( which behaved like echo but without terminating its output with a line delimiter ). On PWB / UNIX and later Unix System III, echo started expanding C escape sequences such as \n with the notable difference that octal escape sequences were expressed as 0ooo instead of ooo in C. Eighth Edition Unix echo only did the escape expansion when passed a - e option, and that behaviour was copied by a few other implementations such as the builtin echo command of Bash or zsh and GNU echo. Nowadays, several incompatible implementations of echo exist on different operating systems ( often several on the same system ), some of them expanding escape sequences by default, some of them not, some of them accepting options ( the list of which varying with implementations ), some of them not. The POSIX Specification of echo leaves the behaviour unspecified if the first argument is - n or any argument contain backslash characters while the Unix specification ( XSI option in POSIX ) mandates the expansion of ( some ) sequences and does not allow any option processing. In practice, many echo implementations are not compliant in the default environment. Because of these variations in behaviour, echo is considered a non-portable command on Unix - like systems and the printf command ( where available, introduced by Ninth Edition Unix ) is preferred instead. Usage example > echo Hello world Hello world Using ANSI escape code SGR sequences, compatible terminals can print out colored text. Using a System III - style implementation of echo ) : BGRED = ` echo `` 033 ( 41m '' ` FGBLUE = ` echo `` 033 ( 35m '' ` BGGREEN = ` echo `` 033 ( 42m '' ` NORMAL = ` echo `` 033 ( m '' ` Or a Unix Version 8 - style implementation ( such as Bash when not in Unix - conformance mode ) : BGRED = ` echo - e `` 033 ( 41m '' ` FGBLUE = ` echo - e `` 033 ( 35m '' ` BGGREEN = ` echo - e `` 033 ( 42m '' ` NORMAL = ` echo - e `` 033 ( m '' ` and after : echo `` $ ( FGBLUE ) Text in blue $ ( NORMAL ) '' echo `` Text normal '' echo `` $ ( BGRED ) Background in red '' echo `` $ ( BGGREEN ) Background in Green and back to Normal $ ( NORMAL ) '' Portably with printf : BGRED = ` printf ' 33 ( 41m ' ` NORMAL = ` printf ' 33 ( m ' ` printf ' % s \n ' `` $ ( BGRED ) Text on red background $ ( NORMAL ) '' See also List of Unix Programs List of DOS commands References Jump up ^ https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html Jump up ^ http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html Jump up ^ McIlroy, M.D. ( 1987 ). A Research Unix reader : annotated excerpts from the Programmer 's Manual, 1971 -- 1986 ( PDF ) ( Technical report ). CSTR. Bell Labs. 139. Jump up ^ Mascheck, Sven. `` echo and printf behaviour ''. Retrieved 24 July 2016. Jump up ^ `` 8th Edition Unix echo man page ''. Retrieved 24 July 2016. Jump up ^ echo : write arguments to standard output -- Commands & Utilities Reference, The Single UNIX Specification, Issue 7 from The Open Group Jump up ^ `` Autoconf documentation on echo portability ''. Free Software Foundation. Retrieved 24 July 2016. External links echo : write arguments to standard output -- Commands & Utilities Reference, The Single UNIX Specification, Issue 7 from The Open Group Microsoft TechNet Echo article Unix command - line interface programs and shell builtins File system cat chmod chown chgrp cksum cmp cp dd du df file fuser ln ls mkdir mv pax pwd rm rmdir split tee touch type umask Processes at bg crontab fg kill nice ps time User environment env exit logname mesg talk tput uname who write Text processing awk basename comm csplit cut diff dirname ed ex fold head iconv join m4 more nl paste printf sed sort strings tail tr uniq vi wc xargs Shell builtins alias cd echo test unset wait Searching find grep Documentation man Software development ar ctags lex make nm strip yacc Miscellaneous bc cal expr lp od sleep true and false Categories Standard Unix programs Unix SUS2008 utilities List Windows command - line programs and shell builtins COMMAND.COM Command Prompt Windows PowerShell Recovery Console File system navigation cd ( chdir ) dir popd pushd tree File management attrib cacls cipher compact copy del ( erase ) deltree expand icacls makecab md ( mkdir ) move rd ( rmdir ) recover ren ( rename ) replace rmdir robocopy xcopy Disk management chkdsk convert defrag diskcomp diskcopy diskpart fdisk format label subst scandisk sys vol vssadmin Processes exit kill powercfg runas sc shutdown start taskkill tasklist Registry assoc ftype reg regini regsvr32 User environment date mode path set setx time title ver whoami File contents comp edlin fc find findstr print type Scripting choice clip cscript doskey echo for goto if more pause prompt rem Networking arp getmac hostname ipconfig net use netsh netstat nslookup PathPing ping route tracert Maintenance and care driverquery msiexec ntbackup sfc systeminfo w32tm WBAdmin winsat wmic Boot management bcdedit bootcfg fixboot fixmbr Software development debug exe2bin QBasic Miscellaneous cls help List of DOS commands Environment variables Retrieved from `` https://en.wikipedia.org/w/index.php?title=Echo_(command)&oldid=818343828 '' Categories : Windows commands Internal DOS commands OS / 2 Windows administration Standard Unix programs Unix SUS2008 utilities Computing commands Talk Contents About Wikipedia Čeština Deutsch Ελληνικά Español فارسی Français 한국어 Hrvatski Italiano עברית Lietuvių Magyar 日本 語 Polski Português Română Русский Svenska Українська Tiếng Việt 中文 13 more Edit links This page was last edited on 3 January 2018, at 00 : 43. Text is available under the Creative Commons Attribution - ShareAlike License ; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia ® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. About Wikipedia

Question: why do we use echo command in unix
Answer: to output status text to the screen or a file