../_images/space.png

Kansas State University at Salina

Introduction to Unix

../_images/UNIX_blocks.jpeg

The Pipe (|)

A pipe is a facility of the shell that makes it easy very to chain together multiple commands. A pipe is called upon with the vertical bar character (|). When used between two Unix commands, it means that output from the first command should become the input to the second command. For example, to count how many files underneath a directory have been modified in the last day, the find and wc commands may be used along with a pipe (Finding Files, Counting with wc). The find command will list the modified files and wc can count them:

find . -type f -mtime -1 | wc -l

tee

tee

Copy standard input to each FILE, and also to standard output.

SYNOPSIS

tee [-a] [FILE]...

OPTIONS

-a, --append

append to the given FILEs, do not overwrite

Table Of Contents

Previous topic

Here Documents

Next topic

Command Substitution

This Page