Here, the redirection can be understood as follows:
The original output method is like a faucet that drains water into a pool (screen), and water is the content to be output
When the faucet is transferred to a bucket (file) that is not a pool, it is redirected.
The output methods in Linux are mainly:
Two ways of standard output:
STDOUT standard output
STDERR standard error
The output of the screen can be redirected so that the content that should have been output to the screen is redirected to other places,
For example: File:
Format: Command operation file name < Br>
egls /etc -l 1> ls.txt 2>err.txt
where:
The command is still the original command, all known output commands are is allowed.
The operation is the type of output, there are
1> one class, STDOUT
2> second class, STDERR
&> all (including Class 1 and Class 2 messages) Note that if there is an error message in the output at this time, it will be output first, regardless of whether the class 1 or class 2 output is executed first.
> If no number (type) is added, the default is Standard output, ie 1
The operation it performs is to first delete the file to be redirected,
Note this, whether it is append or append to temporary file. >
The file name is the location to be redirected to. If the file is already in the original path, it will be overwritten. If not, it will be generated.
If you want the content in the original file not to be overwritten but appended later (written in the back) then you can use the following operation
1>> with >>< Br>
2>>
&>>
If the output being redirected has standard output and standard error output when appending mode, then
eg ls /etc /wrongdir 1>>ls.txt 2>>err.txt
ls /etc /wrongdor 1>>ls.txt 2>>ls.txt
However, I have seen it in ubuntu12.04 and it is ok to use &>>.
When a certain type of output is redirected, the output of the class will not be displayed on the screen.
When both the standard output and the standard error output exist, the redirect is determined according to the type of operation. Content and redirected files.
head command: from the beginning
tail command: look at the tail
can be followed by parameters for processing:
e.g. cat 5.txt
Two virtual network cards after installing the virtual machine: 1.bridged (bridge mode) <?喎& #
1, role: list the contents of the directory; 2, format: ls [options] [files] [options] is
Liunx shared file server uses samba, so the linux shared server is to set up the samba server; 1, n
File descriptors in server programming
Linux installer and common methods of relying on the installation package
The use of the Linux primary command useradd and detailed
Linux interrupt processing flow
Unix/Linux Software Installation
Gcc parameters commonly used under Linux
Implement monitoring process network bandwidth under linux
Create a user with a password under Linux
Linux boot management --- systemd uses
How to use the command to delete and create the Linux folder
Install the quick broadcast prompt "Extract, can not write to the file"
Microsoft strengthens the ability to interact with paper for Windows 7
How Win10 sets any color to theme color
After upgrading win10 preview version 9926, I can't access LAN solution
Win8.1 family group how to delete the Win8/8.1 desktop family group icon method
Getting along with IE6 apps in Windows 7
Top 10 security features hidden in Win7 system
How to search for apps in the Win8 app store How to search for apps in the
Windows RT jailbreak tool can run unsigned program
Win7 method to improve the switching speed of the toolbar (suitable for page users)