Вы находитесь на странице: 1из 13

Unix Text Tools

Brian Pitts
Kissinger Lab

February 21, 2011

Outline
Introduction Shell Regular Expressions Grep Sed Awk Comparing Files

Here Document

Input
cat <<EOF Hello World EOF

Here Document

Input
cat <<EOF Hello World EOF

Output
Hello World

Tee

[brian@triangle pres]$ date Sun Feb 20 20:38:01 EST 2011 [brian@triangle pres]$ date | tee the_date Sun Feb 20 20:38:16 EST 2011 [brian@triangle pres]$ cat the_date Sun Feb 20 20:38:16 EST 2011 [brian@triangle pres]$ date | tee -a the_date Sun Feb 20 20:38:26 EST 2011 [brian@triangle pres]$ cat the_date Sun Feb 20 20:38:16 EST 2011 Sun Feb 20 20:38:26 EST 2011

Samples
mark
AmoebaDB CryptoDB GiardiaDB PlasmoDB

jeremy
AmoebaDB PlasmoDB ToxoDb TrichDB

Comm
Input
comm mark jeremy

Comm
Input
comm mark jeremy

Output
AmoebaDB CryptoDB GiardiaDB PlasmoDB ToxoDb TrichDB

cmp

Input
cmp mark jeremy

cmp

Input
cmp mark jeremy

Output
mark jeremy differ: byte 10, line 2

Title

title

Input

title

Input

Output

Вам также может понравиться