In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the Linux redirection method". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use the Linux redirection method".
Data flow in Linux
When it comes to Linux redirection, we have to mention the following three types of data flows:
The input information is read from the stdin (standard input, usually keyboard or mouse).
The output information is output to stdout (standard output, a text file, or data stream).
The error message is output to stderr.
Knowing the existence of these data streams, you can better control the flow of data when you use Shell.
In Linux systems, standard input, standard output, and standard error all exist as files. You can see them in the / dev directory:
$ls / dev/std* / dev/stderr / dev/stdin / dev/stdout
Redirect output
In Linux systems, the > character is used to indicate redirected output. For example, redirect the output of the ls command to a file:
$ls > list.txt
After executing the above command, the output of the ls command is not displayed on the screen because the output has been redirected to the list.txt file.
In addition, redirection has many uses, it can also be used to copy the contents of files, and not limited to copying text files, binary files can also be copied:
$cat image.png > picture.png
If you want to copy the contents of one file to the end of another, you just need to replace the > character with the > > string, like this:
$cat lxlinux > > alvin
Redirect input
In contrast to redirected output, redirected input uses the
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.