Linux commands (3) echo

Source: Internet
Author: User

Linux of the Echo Command , in the Shell extremely popular in programming , Print variables under the terminal value is often used. , Echo command in the build Shell play an important role in scripting

1. command Format

Echo[options] [String]

2. Command function

List all subdirectories and files in the destination directory

3. Command Parameters

- N do not wrap at the end of the line

The--HELP displays help information on the standard output.

the--version outputs the version information on the standard output and exits.

-e If the following characters appear in the string, they are handled in particular, not as a general

Text output:

\a issued a warning sound;

\b Delete the previous character;

\c finally not add the line break symbol;

\f the line but the cursor remains in its original position;

\ n wraps and the cursor moves to the beginning of the line;

\ r the cursor moves to the beginning of the line, but does not wrap;

\ t insert tab;

\v is the same as \f ;

\ \ Insert \ character;

\NNN inserts the ASCII characterrepresented by the NNN (octal) ;

4. Command Instances

Example 1: Entering a line of text and displaying it on standard output

[Email protected] data]# echo I am boy

I am boy

Example 2: Writing a string directly to a file

[email protected] data]# cat Ttt.txt

Asdfasdfasdfasdf

Asfasdfasdfasdfasdf

Dddddddddddddddddddddddd

[[email protected] data]# echo ' Hello word ' >ttt.txt

[email protected] data]# cat Ttt.txt

Hello Word

Example 3:echo-n non-newline output

[[email protected] ~]$ echo-n "123"; Echo 456

123456

Example 4:echo-e handling special characters

[Email protected] ~]$ echo-e "A\BBCD"

Bcd

[Email protected] ~]$ echo-e "A\NBCD"

A

Bcd

Reference:http://blog.csdn.net/lizhi200404520/article/details/8819762


Linux commands (3) echo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.