Linuxlab

Streams and pipelines

In the terminal commands rarely work alone. You connect them: send one command's output to a file, or feed it straight into the next command. That is how a few simple commands produce a one-line log summary. In this lesson you redirect output to a file, append to it, and build a pipeline that counts lines and ranks addresses.

The log file ~/access.log is already in the sandbox: six lines of requests to a web server.

What to understand

A stream is a flow of data a command reads from or writes to. Every command has an input (stdin) and an output (stdout). By default the input is the keyboard and the output is the screen.

Redirection sends the output to a file instead of the screen. > overwrites the fi

Locked

The rest of this lesson is part of a paid course

You are reading the open part. Buy the course to unlock the whole lesson and its lab.

See the course