In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "what is the concept of redirection in linux", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "what is the concept of redirection in linux" article.
In linux, redirection is to redirect the data information that is supposed to be output to a specific file, that is, to change the default execution of the original system command; redirection is generally achieved by inserting specific symbols between commands. The syntax example is "command1 > file1".
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What is redirection in linux
Linux redirection refers to modifying some of the original default things, changing the default execution mode of the original system commands, for example, simply I do not want to see the output in the monitor but want to output to a file, I can do this work through Linux redirection.
1What exactly is redirection in Personalized Linux?
Redirection in Linux is to redirect the data information that is supposed to be output to the screen to a specific file or to a black hole (/ dev/null).
1.2 what is the use of redirecting?
1, when the program executes a lot of output information, it needs to be saved for paging view.
2, the program executed in the background will generally have output, do not want its output to interfere with the terminal.
3. Perform scheduled backup tasks and want the backup results to be retained.
4. When the user is created repeatedly, some error messages will be prompted, and the information can be discarded directly.
5, when you want to save the error log and the correct log to different files.
1.3 Standard input and output
When a process manipulates a file:
1. First of all, the process cannot access the hardware directly, so you need to use the kernel to access the file.
2, and the kernel kernel needs to use the file descriptor (file descriptor) to access the file.
Summary: process-through-> file descriptor (non-negative integer)-access-"file name; the process uses file descriptors to manage open file correspondence.
Step 1: run tail-f / etc/passwd
Part II: through the file descriptor 3murmury-> / etc/passwd-- > inode-- > block
Step 3: output correctly-> by default, through the file descriptor 1: talk-> current terminal 1 > (change the location of the output, file, black hole)
Step 4: error output-- > by default, through the file descriptor 2murmuri-"current terminal 2 > (error output)"
Usually, a program accesses a file and opens at least three standard files, namely, standard input, standard output, and error output.
The process will get the data from the standard input, print the normal output to the screen terminal, and print the wrong output information to the screen terminal.
The above is the content of this article on "what is the concept of redirection in linux". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.
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.