Skip to content

Latest commit

 

History

History
23 lines (12 loc) · 890 Bytes

09_connecting_things_together.md

File metadata and controls

23 lines (12 loc) · 890 Bytes

Connecting Things Together

Normally output goes to stdout, the screen, and input comes from stdin, the keyboard. Sometimes we don't want this. We can redirect output and input to/from a file and to combine several commands together with redirection and piping.

Redirection

Redirection is all about files.

When we redirect input to a command, data is taken from a file by redirecting the stdin stream. When we redirect output to a file, output from a command is sent to a file by redirecting the output stream.

Redirect Input and Output

Piping

Piping is all about processes.

With piping, we connect the stdout of one command to the stdin of another command as if there were a pipe or a stream of data between the two.

Piping Commands Together

Back: Reading User Input Forward: Who Cares?