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.
Command format:
echo [-ne][string]
Echo $PATH
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
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