Get the App
SLTechnology News&Howtos  ›  Servers  › 

What does linux error output redirect refer to

Shulou Source: shulou.com Published: 2022-05-31 10:41:28 10月01日 Update

This article mainly introduces "linux error output redirection refers to what", in daily operation, I believe many people in linux error output redirection refers to what problems there are doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation methods, hope to answer "linux error output redirection refers to what" doubts helpful! Next, please follow the small series to learn together!

In linux, error output redirection refers to "writing the wrong output information to a file"; output redirection refers to redesignating the device instead of the display as the new output device, usually replacing the keyboard with the file or command execution result, and the new output device generally refers to the file.

Operating environment: Linux 7.3 system, Dell G3 computer.

Linux error output redirection is what?

We know that the standard input device in Linux refers to the keyboard by default, and the standard output device refers to the monitor by default. The input and output redirections described in this section can be understood literally, that is:

Input redirection: refers to the reassignment of a device to replace the keyboard as the new input device;

Output redirection: refers to the reassignment of a device to replace the monitor as the new output device.

A file or the result of a command is usually substituted for the keyboard as the new input device, and the new output device is usually referred to as a file.

What is Input Redirection?

In layman's terms, input redirection is to write the information to be input to a specified file

What is output redirection?

In layman's terms, output redirection is to write the information to be output to a file instead of outputting the file information to the console (display screen).

What is wrong redirection?

In layman's terms, error redirection is to write the wrong information to a file

Linux output redirection

We use output redirection more frequently than input redirection. And, unlike input redirection, output redirection can also be subdivided into standard output redirection and error output redirection.

For example, using ls command to view the attribute information of two files separately, but one of them does not exist, as follows:

[root@localhost ~]# touch demo1.txt[root@localhost ~]# ls -l demo1.txt-rw-rw-r--. 1 root root 0 Oct 12 15:02 demo1.txt[root@localhost ~]# ls -l demo2.txt

Tags: Output files errors devices inputs information commands that is standards keyboards learning popular displays properties more results help different practical and then Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Apple vpn NVidia Linux