In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "the usage of linux echo command". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In linux, the echo command is used for the output of strings, with the syntax "echo [options] [output content]"; if there is no special meaning in the output, the original content is output to the screen; if the output has a special meaning, the output prints its meaning.
The operating environment of this tutorial: CentOS 6 system, Dell G3 computer.
The echo instruction is similar to the PHP echo instruction in that it is used for string output.
The format of the command is as follows:
# echo [options] [output]
Options:
-e: support backslash-controlled character conversion (see Table 1 for details)
-n: the newline symbol at the end of the line after canceling the output (no line wrapping after the content is output)
In fact, the echo command is very simple. If the output of the command has no special meaning, the original content is output to the screen; if the output has a special meaning, the output prints its meaning.
[example 1]
[root@localhost ~] # echo "c.biancheng.net" # echo will be printed to the screen c.biancheng.net [root@localhost ~] #
The echo command is that simple. Whatever you output, it will be printed to the screen.
[example 2]
[root@localhost ~] # echo-n "c.biancheng.net" c.biancheng.net [root@localhost ~] # if the "- n" option is added, there will be no line wrapping after the end of the output, but the prompt for the new line will be displayed directly
If you use the "- e" option in the echo command, you can support control characters, as shown in the following table.
The control character is used to\\ output\ itself\ an output warning tone\ b backspace key, that is, delete key to the left\ c to cancel the newline character at the end of the output line. Consistent with the "- n" option\ eESC\ f feed character\ n feed character\ r enter key\ t tab, that is, Tab key\ v vertical tab character\ Onnn outputs characters according to the octal ASCII code table. Where 0 is the number 0 xhh is a three-digit octal number\ xhh outputs characters according to the hexadecimal ASCH code table. Where hh is a two-digit hexadecimal number, "the use of the linux echo command" is introduced here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.