One Linux command per day-echo

Source: Internet
Author: User
Tags echo command

The echo command in Linux is commonly used to print strings, or to print variable values, and is used more often in real work, all with the necessary learning of his parameters and some common uses.

    1. Command format:

      echo [-ne][string]

      Echo $PATH

    2. Command function:

      Display the string or variable information, in the daily script to do some descriptive explanation, to the user to prompt information.

      Echo will send the input string to standard output. The output string is separated by a white space character, and a newline number is added at the end

    3. Command parameters:

      -N: Do not wrap at the end of the line.

      -E: Use backslash special characters to interpret


\a: Issue a warning tone

\b: Delete the previous character

\c: No newline symbol at the end, the effect is the same as-n

\e: Delete one character after

\f: newline, but cursor remains in original position

\ n: Wrap, move cursor to beginning of line

\ r: Moves the cursor to the beginning of the line, the characters after the \ R are prioritized, and the characters above \ r are overwritten by a bit.

\ t: Insert tab

\v: Equivalent to \f

\ \: Display \

-E: Do not use backslash special character interpretation, this is the default option.

--version: Display version

--HELP: Display Help document

4. Command instance:

1./n/t

[Email protected] ~]# echo-e "A\tb\nc\te" a BC E[[email protected] ~]#

2.-N \b \a

[[email protected] ~]# Echo-ne "A\tb\tc\nd\te\bf\a" a b CD f[[email protected] ~]#

3. Print variables

[Email protected] ~]# echo $PATH #环境变量/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/ Usr/bin:/root/bin[[email protected] ~]#


One Linux command per day-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.