From the course: Ubuntu Linux: Essential Commands
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Input/output redirection
From the course: Ubuntu Linux: Essential Commands
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…
Contents
-
-
-
-
(Locked)
Files on Linux10m 27s
-
(Locked)
Text files8m 52s
-
(Locked)
Work with files and directories10m 16s
-
File links7m 27s
-
(Locked)
Finding files4m 40s
-
(Locked)
Input/output redirection6m 18s
-
(Locked)
Compare text files4m 43s
-
(Locked)
Compare non-text files3m 20s
-
(Locked)
Compress and decompress files9m 12s
-
(Locked)
Explore regular expressions3m 36s
-
(Locked)
Change files programmatically4m 42s
-
(Locked)
-
-