Discover how to take the output from one command and send it to another command as input.
- [Instructor] We've seen how to send data from one command … to a file and from a file to a command. … And this movie will learn to send data … from one Unix command to another Unix command. … And we'll do that using a technique called piping. … The way that we pipe output to input … is by using what we call the pipe operator. … And it looks like a pipe, is that vertical bar. … You probably will find it on the far right side … of your keyboard, above return. … Unlike the previous examples, there's no file involved here. … We have one command that's on the left, … and its output is going to become the input … to the second command on the right. … To demonstrate this, let's start by just taking a look … at what's inside the people.txt file. … I'm using the Cat command in order to do that. … In this case the output from the command … went to the terminal window. … If we instead use that pipe operator, … we can send that data somewhere else. … Let's send it to these sort command. … So I have two commands, Cat and sort. …
Skill Level Intermediate
1. Introduction to Unix
2. Files and Directories
3. Ownership and Permissions
4. Commands and Processes
5. Directing Input and Output
6. Configure Your Working Environment
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.