tee

read from standard input and write to standard output and files

Syntax

tee [OPTION]... [FILE]...

Description

Read from standard input and write to standard output and files. Copy standard input to each FILE, and also to standard output.

Options

-a, --append
       append to the given FILEs, do not overwrite

-i, --ignore-interrupts
       ignore interrupt signals

Example 1

Demonstrate tee command.

[eleiss@eleiss ~]$ cat names | head -5 | tee girls
divya
dharmi
priti
komal
priyanka
[eleiss@eleiss ~]$ cat girls 
divya
dharmi
priti
komal
priyanka
tulsi
vanita
rupa
[eleiss@eleiss ~]$

The above command prints first five lines from the file "names" and also stores the same output in a file "girls" in current directory.


You may write to resources@eleiss.com for any Linux related queries.

advertisement