if you are interested to contribute your LAB PROGRAM Please send mail to jkumaron@gmail.com

Linux Diff Command Diff Vimdiff Gvimdiff

diff it can be used to compare the Two files
vimdiff perform the diff using vim
gvimdiff Perform vimdiff and provide Graphical editor
diff -w file1 file2
-w ignore the white space
diff command it telling about
'<' -Mention First File word (or) character Located in the first file

'>' -Mention Second File Word (or) Character have extra word in the second file

"---" mention it will compare the same line for the two files.
< Installing setup-2.5.58-7.el5.noarch rhel5
> Installing setup-2.5.58-7.el5.noarch
We can also use the Vimdiff -> it is vim editor,
It will compare the two file using different colors and  we can can compare the n no of files like,
#vimdiff file1 file2 file3
gvimdiff -Graphical vimdiff editor.  

test1,2,3 file are locate only under the /tmp/p1 these file are not persent under /tmp/p2
#diff /tmp/p1 /tmp/p2
Only in /tmp/p1: test1
Only in /tmp/p1: test2
Only in /tmp/p1: test3

Related post