10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Platform :Oracle Linux 6.4
Shell : bash
In the below sample, although the lines in a.txt and b.txt are jumbled up, there is only one difference : b.txt has an extra line NETHERLANDS
$ cat a.txt
SPAIN
NORTH KOREA
PORTUGAL
GERMANY
SYRIA
$
$
$ cat b.txt
GERMANY
NORTH KOREA
SPAIN... (6 Replies)
Discussion started by: John K
6 Replies
2. Shell Programming and Scripting
Hello,
I am trying to find the different files between multiple directories in Linux, here is a small assumption of what is inside the directories
dir1 dir2 dir3
1.txt 1.txt 1.txt
2.txt 3.txt 3.txt
5.txt 4.txt 5.txt
6.txt 7.txt 8.txt
I am using the following... (4 Replies)
Discussion started by: Error404
4 Replies
3. UNIX for Dummies Questions & Answers
Hi Guys
I have a situation where I would like to use the diff command but I would like to see "number" of differences and than send it through and if statement and than view the difference if greater than 1.
Eg. diff file1 file2 > than gives the "number" and I than say -
if number >1... (3 Replies)
Discussion started by: Prega
3 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I use the diff command to compare two files and append this output to a file. I would like to now not only produce the differences but be able to output the total number of changes made, the number of new files added and the number of files deleted, is there I can do this using the diff... (2 Replies)
Discussion started by: cyberfrog
2 Replies
5. 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
6. UNIX for Dummies Questions & Answers
Is there any option for the diff command (or maybe an entirely different command) that will give you only the text that differs between two files? When I use diff file1 file2, if any text on that line differs from one file to the next it'll print out the entire line. I'd like to see only the text... (2 Replies)
Discussion started by: red baron
2 Replies
7. AIX
hello
i've two files.
how i get the diff between the two files to new file.
thanks
best regards
ariec (3 Replies)
Discussion started by: ariec
3 Replies
8. Shell Programming and Scripting
i have 2 file named test1,test2
contents of test1:
1
2
3
---------------------------
contents of test2:
1
2
3
4
5
--------------------------------------------------------
my desired o/p should be:
diff test2 test1
4 (5 Replies)
Discussion started by: ali560045
5 Replies
9. 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
10. 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
diffmk(1) General Commands Manual diffmk(1)
NAME
diffmk - Marks differences between files
SYNOPSIS
diffmk [-b] [-ab'mark'] [-ae'mark'] [-cb'mark'] [-ce'mark'] [-db'mark'] [-de'mark'] file1 file2
The diffmk command compares two versions of a file and creates a new file that marks the differences.
OPTIONS
Uses mark to mark where added lines begin. Uses mark to mark where added lines end. Ignores differences that are only changes in tabs or
spaces on a line. Uses mark to mark where changed lines begin. Uses mark to mark where changed lines end. Uses mark to mark where
deleted lines begin. Uses mark to mark where deleted lines end.
DESCRIPTION
The file1 and file2 variables are the old and new versions of the file, respectively. The diffmk command compares them and writes a new
version to standard output, which can be redirected to a file. This output contains the lines of file2 marked with nroff change mark
requests (.mc), or with the marks you specify with the -ab, -ae, -cb, -ce, -db, and -de options.
When output containing requests is formatted with nroff, changed or inserted lines are marked by a | (vertical bar) at the right margin of
each line. An * (asterisk) indicates that a line was deleted.
If the DIFFMARK environment variable is defined, it names a command string that diffmk uses to compare the files. (Normally, diffmk uses
the diff command.) For example, you might set DIFFMARK to diff -h in order to better handle extremely large files.
EXAMPLES
To mark the differences between two versions of a text file, enter: diffmk -ab'>I:' -ae'<I' -cb'>C' -ce'<C' -db'>D' -de'<D'
chap1.old chap1 >chap1.diffs
This causes diffmk to create a copy of chap1 called chap1.diffs, showing differences between chap1.old and chap1. Additions of one
or more lines are marked with >I and <I, changed lines are marked with >C and <C, and deletions are marked with >D and <D. To mark
differences with nroff requests, enter: diffmk chap1.old chap1 > chap1.nroff
This produces a copy of chap1 called chap1.nroff containing nroff change mark requests to identify text that was added to, changed,
or deleted from chap1.old. To use different nroff marking requests and ignore changes in white space, enter: diffmk -b -cb'.mc
%' chap1.old chap1 > chap1.nroff
This imbeds commands that mark changes with % (percent sign), additions with | (the default, because no -a option is specified), and
deletions with * (the default). It does not mark changes that only involve a different number of spaces or tabs between words (-b).
SEE ALSO
Commands: diff(1), nroff(1)
diffmk(1)