March 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

March 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

tee command and examples

NAME
tee – read from standard input and write to standard output and files

SYNOPSIS
tee [OPTION]… [FILE]…

DESCRIPTION
Copy standard input to each FILE, and also to standard output. -a, –append append to the given FILEs, do not overwrite -i, –ignore-interrupts ignore interrupt signals –help display this help and exit –version output version information and exit If a FILE is -, copy again to standard output.

Usage and Examples:

Example 1: Write output to display, and to a file

$ ls -la | tee file1

Example 2: Search word strings and pipe to file “Sudo_Usages”

$ ls -la /var/log | grep SSH | tee Sudo_Usages

Example 3: Output stored in more than one files

$ ls -la /etc/ | tee file1 file2 fileN

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>