Today, I will mainly talk about small knowledge points such as pipe symbol and redirection. Because the content is simple, I will introduce it as briefly as possible, and let everyone learn the knowledge in the most simple and understandable way.
1. Pipe symbol is
about pipe symbol. No stranger. I saw the understanding of netizens on the Internet, and I felt very good, so I glued it down for everyone to see, and then there are also screenshots of pictures of my own system for testing. You can take a look.
This pipe symbol is really not difficult, so I won't talk about it, let's look at redirection next.
2. Redirect to
look at the above picture. I did the test, the first time I got the complete output, but the second time it prompted that there was no such file. The difference between the two is that the standard output is returned for the first time, and the standard output is returned for the second time. Is the error output. Next
, let’s take a closer look: 1) Here are three examples of output redirection :
First, I created a readme.txt file, and then entered "hehehehehehehhehhehehehehehehhh" in it, and then I used the first method **"Command> File" , input "lallalallallallalallallal" into it, and then check the content to find that the latter has indeed replaced the former. This is the place to be noted. This method will clear the original data! ! !
Then I used the three methods "Command >> File" and entered "jijijijijijijijijijijiji" into it, and I found that there was more new data in the content this time, but the original data was not deleted.
Finally, give another example of redirection of wrong output.
2) Let’s give another example of input redirection**.
Here I send an email to user gao with the subject of "huanying", where "over" is a subsection. The default system will determine the end of the input when it encounters over.
3. Wildcard
1) View all devices starting with sda
2) Match any single character
3) View devices that include numbers 0-9 in sda
4) Match existing devices
At the same time, bash also supports some other characters as follows:
Say it today to here! ! !
Linux pipe character/redirection
Guess you like
Origin blog.csdn.net/Gao068465/article/details/108118244
Ranking