08-20-2009
Problem with diff command
Hello Guys,
I am a newbie to Unix. I was going through the diff command with example
like this,
[mraghunandanan@localhost ~]$ cat 1
1
2
4
0
8
9
[mraghunandanan@localhost ~]$ cat 2
1
0
3
2
8
My output is like this:
[mraghunandanan@localhost ~]$ diff 1 2
2,3d1
< 2
< 4
4a3,4
> 3
> 2
6d5
< 9
I am not able to understand the output, like what is the use of d,a,c and < and > symbols in this output.Can anyone explain the output. It would be of great help.
Regards,
Mahesh Raghunandanan
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Folks,
I am Diff'ing 2 identical files..and the result is, it shows all the lines from 2 files (saying nothing is being matched).
If I copy the content from 1 of the file and paste in a newly created file and then do the diff, it equals.
2 files are xml files.
I've tried many... (4 Replies)
Discussion started by: gvsreddy_539
4 Replies
2. Shell Programming and Scripting
Hi,
When i use diff command, i get the output like this
2c2
< Table Name: AAA Row Count:96 SUM(F1): 3739 MAX(F1):77 MIN(F1): 0 AVG(F1): 38.9479167 LENGTH(LINE): 2260
---
> Table Name: AAA Row Count:96 SUM(F1): 4009 MAX(F1):77 MIN(F1): 0 AVG(F1): 40.9479167 LENGTH(LINE): 2260
4a5,10
>... (6 Replies)
Discussion started by: ragavhere
6 Replies
3. Shell Programming and Scripting
All,
How to exclude a directory while diff execution?
For ex:
To exclude file which we don't want to see diff, we have -x <filename>.
Thanks in advance (1 Reply)
Discussion started by: Vichu
1 Replies
4. Shell Programming and Scripting
Hi all
diff file1 file 2
command will give us op of diff between two file. But it aslo give its position and sign "<" or ">". I dont want position and sign in op. Only diff of content should be come as op.
Kindly help me for this.
Regards
Jaydeep (1 Reply)
Discussion started by: jaydeep_sadaria
1 Replies
5. UNIX for Advanced & Expert Users
Hi,
I am trying to do a diff between two files using "diff" command.I dont need my output to be printed using extra symbols ">" and "<" as we usually see for the diff command. Even to excude these characters in each line of the output, my diff output has inturn many symbols ">" and "<".
... (1 Reply)
Discussion started by: pharitha
1 Replies
6. UNIX for Dummies Questions & Answers
I am trying to do a diff between two files using "diff" command.I dont need my output to be printed using extra symbols ">" and "<" as we usually see for the diff command. Even to excude these characters in each line of the output, my diff output has inturn many symbols ">" and "<".
Please help.... (2 Replies)
Discussion started by: pharitha
2 Replies
7. UNIX for Dummies Questions & Answers
Hello,
Apologies if this question has been repeated before, but I am getting myself confused even more as I scan the posts!
I have two files, file1 is a column:
1dlwa_
1s69a_
1idra_
1ngka_
And file2 has three columns (columns seperated by tabs):
1dlw a_ A
1uvy a_ A
1dly a_ A
1uvx... (1 Reply)
Discussion started by: InfoSeeker
1 Replies
8. Shell Programming and Scripting
Hi All,
I havae 2 files like this
File1.dat.tar.gz--- has
+667866066123|20110506
+667866066866|20110405
File2.dat.tar.gz -----contains
+447866066123|20110505
+447866066866|20110405
If I give
Gzcat File1.dat.tar.gz | cut –d “|” –f 1 > out1.dat
Gzcat File2.dat.tar.gz| cut –d... (4 Replies)
Discussion started by: suresh01_apk
4 Replies
9. Shell Programming and Scripting
Hi,
I need to get only different rows from comparing two files , i donot need the place of row or any other error comments , just my data , Can anyone help me please?
example:
$Diff -b reham.txt reham1.txt
7a8(DON'T NEED IT)
> hany 4/4/1989 $100,000
\ No newline at end... (9 Replies)
Discussion started by: Reham.Donia
9 Replies
10. Shell Programming and Scripting
I am using the diff command, but i cant figure out why it is displaying these strange numbers and letters
diff spellExample spellExample.bak
1c1
< I went to a garden party
---
> I went to a gadren party
3c3
< bunch of my old friends did something
---
> bnuch of my old freinds did... (2 Replies)
Discussion started by: football12345
2 Replies
LEARN ABOUT DEBIAN
cut-diff
CUT-DIFF(1) Cutter's manual CUT-DIFF(1)
NAME
cut-diff - show difference between 2 files with color
SYNOPSIS
cut-diff [option ...] file1 file2
DESCRIPTION
cut-diff is a diff command that uses diff feature in Cutter. It shows difference with color.
It's recommended that you use a normal diff(1) when you want to use with patch(1) or you don't need color.
OPTIONS
--version
cut-diff shows its own version and exits.
-c [yes|true|no|false|auto], --color=[yes|true|no|false|auto]
If 'yes' or 'true' is specified, cut-diff uses colorized output by escape sequence. If 'no' or 'false' is specified, cut-diff never
use colorized output. If 'auto' or the option is omitted, cut-diff uses colorized output if available.
The default is auto.
-u, --unified
cut-diff uses unified diff format.
--context-lines=LINES
Shows diff context around LINES.
All lines are shown by default. When unified diff format is used, 3 lines are shown by default.
--label=LABEL, -L=LABEL
Uses LABEL as a header label. The first--label option value is used as file1's label and the second --label option value is used
asfile2's label.
Labels are the same as file names by default.
EXIT STATUS
The exit status is 0 for success, non-0 otherwise.
TODO: 0 for non-difference, 1 for difference and non-0 for errors.
EXAMPLE
In the following example, cut-diff shows difference between file1 and file2:
% cut-diff file1 file2
In the following example, cut-diff shows difference between file1 and file2 with unified diff format:
% cut-diff -u file1 file2
SEE ALSO
diff(1)
Cutter February 2011 CUT-DIFF(1)