Method 1 : use command comm to compare two sorted files line by line.
Usage: comm [OPTION]... FILE1 FILE2
With no options, produce three-column output. Column one contains
lines unique to FILE1, column two contains lines unique to FILE2,
and column three contains lines common to both files.
-1 suppress lines unique to FILE1
-2 suppress lines unique to FILE2
-3 suppress lines that appear in both files
Example:
file1.txt content
# cat file1.txt kelvin@example.com ryan@alpha.com
file2.txt content
# cat file2.txt ryan@alpha.com susan@sina.com
Show content appears in both files
#comm -12 file1.txt file2.txt ryan@alpha.com
Method 2: use command diff to compare 2 files line by line
Usage: diff [OPTION]... FILES
Example
# diff file1.txt file2.txt 1d0 < kelvin@example.com 2a2 > susan@sina.com
Method 3: use command sdiff to compare side-by-side merge of file differences
Usage: sdiff [OPTION]... FILE1 FILE2
Example
# sdiff file1.txt file2.txt kelvin@example.com < ryan@alpha.com ryan@alpha.com > susan@sina.com
Tags
antivirus bash script comm configd coovaap wrt54g no space left dd-wrt hard reset dd-wrt wr741nd hard reset diff firewall free google seo i.t. support iptables IT Support keywords meta tag linux linux mysql linux script mac mac freeze mac freeze when awaking from hibernate mode meta tag multi boot linux windows netbios parallels desktop freeze pc repair pc support real time traffic remote backup rsync rsync space search engine security seo tcpdump tips useful linux command virtualization wireless ap wrt54g recovery 上門電腦維修 中小企 電腦維修