diff Command JACARY RICHARDSON NHANTRUNG PHAN Unix/Linux Command: - - PowerPoint PPT Presentation

diff command
SMART_READER_LITE
LIVE PREVIEW

diff Command JACARY RICHARDSON NHANTRUNG PHAN Unix/Linux Command: - - PowerPoint PPT Presentation

diff Command JACARY RICHARDSON NHANTRUNG PHAN Unix/Linux Command: diff The diff utility is at its very base a data comparison tool Generally, the diff command compares two files in the following format: diff filename1 filename2


slide-1
SLIDE 1

diff Command

JACARY RICHARDSON NHANTRUNG PHAN

slide-2
SLIDE 2

Unix/Linux Command: diff

 The diff utility is at its very base a data comparison tool  Generally, the diff command compares two files in the following

format:

 diff filename1 filename2

 If you use a filename of just “-”, you can compare text from the standard

input with a different file  diff is a line-oriented comparison tool and tries to find the smallest

numbers of insertion and deletions to create one file from the other

 Diff options begin with a “-” so you can’t use a file whose name

starts with a “-”

slide-3
SLIDE 3

diff options

 -a: Treat all files as text files  -b: Ignore changes in amount of white space (such as spaces or

tabs)

 -B: Ignore changes in amount of blank or empty lines  -e: Create an editing script that contains a sequence of commands

to change one file’s contents to another that can you used in the editing programs ed/ex

 -i: Ignore difference in cases (upper and lower case characters are

treated the same)

 -y: Display output in two columns

slide-4
SLIDE 4
  • Lines that aren’t changed aren’t

shown in diff

  • In standard output a = add, c =

changed, and d = deleted

  • Line numbers of the first file are

shown before a/c/d and line numbers of the second file are displayed after

  • < is a deletion line showing that

the line is deleted in the second file

  • > is an addition line that shows

the line is added in the second file

slide-5
SLIDE 5

Works Cited

 http://linux.about.com/library/cmd/blcmdl1_diff.htm  http://www.computerhope.com/unix/udiff.htm