课程: Ubuntu Linux: Essential Commands
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Input/output redirection
- [Narrator] It can be useful to change where the output from a command goes. This is called redirection, and we can redirect text both into and out of a command. We can also use what are called pipes to send the output one command to another command as input. To start with, let's use the echo command, which takes text as an input and just returns it back to us as an output like this. I'll write echo some text. If I want the response to go somewhere other than the terminal output here, which is called the standard output, I can use a greater than sign to send it to a file. I'll write echo "some text" > output.txt. I don't get any response now, and if I write cat output.txt, I can see that the output that I would have seen at the terminal is inside this file instead. If were to echo something else to the file, and then take a look at that again, that information has completely replaced what was there before. That's because the single greater than operator replaces the contents of…
内容
-
-
-
-
(已锁定)
Files on Linux10 分钟 27 秒
-
(已锁定)
Text files8 分钟 52 秒
-
(已锁定)
Work with files and directories10 分钟 16 秒
-
File links7 分钟 27 秒
-
(已锁定)
Finding files4 分钟 40 秒
-
(已锁定)
Input/output redirection6 分钟 18 秒
-
(已锁定)
Compare text files4 分钟 43 秒
-
(已锁定)
Compare non-text files3 分钟 20 秒
-
(已锁定)
Compress and decompress files9 分钟 12 秒
-
(已锁定)
Explore regular expressions3 分钟 36 秒
-
(已锁定)
Change files programmatically4 分钟 42 秒
-
(已锁定)
-
-