In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use the Linux pipeline command for you. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The pipeline command can take the output of the previous command as the input of the latter command, and only retain the information we need. The pipeline command can only deal with the correct information transmitted through the previous command, that is, the information of standard output. There is no ability to deal with standard error directly.
Output description of the management command:
The correct output of [instruction 1] is used as the input of [instruction 2] and then the output of [instruction 2] is used as the input of [instruction 3], and the output of [instruction 3] will be displayed directly on the screen.
After passing through the pipeline, the correct output of [instruction 1] and [instruction 2] is not displayed on the screen.
[reminder]:
\ 1. The pipe command only handles the correct output of the previous command, not the error output.
\ 2. The command to the right of the pipe command must be able to receive standard input stream commands.
Take a chestnut # 1. Read out the contents of the logcat.log file and forward it to grep as input through the pipeline
# 2. Read out the contents of the logcat.log file, forward it to grep as input through the pipeline, filter the lines containing 'Displayed', and then forward the output as input to the next grep through the pipeline.
# 3. Read out the contents of the logcat.log and wirelessqa.log files, the wrong contents will be printed on the screen, and the correct ones will be transmitted to grep through the pipeline.
# 4. Read out the contents of the logcat.log and wirelessqa.log files, the contents of the error will be redirected to / dev/null, and the correct ones will be piped to grep
# 5. The readout logcat.log is transmitted to ls through the pipeline. Because ls does not support standard input, the previously read data is lost.
This is the end of this article on "how to use Linux pipeline commands". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.