diff Command
JACARY RICHARDSON NHANTRUNG PHAN
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
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
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 “-”
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
shown in diff
changed, and d = deleted
shown before a/c/d and line numbers of the second file are displayed after
the line is deleted in the second file
the line is added in the second file
Works Cited
http://linux.about.com/library/cmd/blcmdl1_diff.htm http://www.computerhope.com/unix/udiff.htm