10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am using the below command to get the diff output of two files.
Here in the output file, I wish to add line number in front of each line starting position.
Please suggest the diff options or some command line utilities.
diff -y file1.txt file2.txt --width=300 > diff_f1_f2_300.txt... (5 Replies)
Discussion started by: k_manimuthu
5 Replies
2. 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
3. Shell Programming and Scripting
I have a csv file that I am trying to edit. I need to remove any comma that is touching a letter. I used this command to find them.
grep , moz_places_good.csv | head -n 10 | grep ,I would think I could use some form of this to just delete the commas and not the letter before it. Just not sure... (5 Replies)
Discussion started by: cokedude
5 Replies
4. Shell Programming and Scripting
Hello Guys,
I request anyone to do me a small help in using diff command for following.
I am trying to compare two files for content and wish to keep the content after the comparison (The resultant file can't be blank)
However, the first lines would be different in both files and I need diff... (2 Replies)
Discussion started by: rockf1bull
2 Replies
5. Shell Programming and Scripting
hi there
Strange title? Well yes...it is strange..."touch" is driving me nutts! Trying to set the access / modified date by a bash script. For a certain time everything works well with all files. After point x the code works only for some files, for others it doesn't. After looking for the ... (4 Replies)
Discussion started by: blah0
4 Replies
6. UNIX for Dummies Questions & Answers
So, I think this is a really stupid question, but I'd like to see if I am right.
If the following commands are entered:
umask 000
touch file1
umask111
touch file2
...nothing should happen...right? The touch operation isn't going to apply any changes from umask to file1 (and same to... (1 Reply)
Discussion started by: Midwest Product
1 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I have a small problem and would be happy if someone could help me to find a solution:
A machine ("server") makes backups of different computers ("clients") using rsync. Users and groups are keept, so that it's possible to copy them back to the client if required. The number of groups... (3 Replies)
Discussion started by: tracer
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. Programming
i need to create a file which contains (/) character.
Any help to do this (1 Reply)
Discussion started by: axes
1 Replies
10. Shell Programming and Scripting
Hi,
Is there any way to achieve diff of two files line by line.
for eg,
a.txt
a
b
c
d
e
b.txt
f
g
h
i
j (1 Reply)
Discussion started by: Omkumar
1 Replies
bdiff(1) General Commands Manual bdiff(1)
NAME
bdiff - Finds differences in large files
SYNOPSIS
bdiff file1 file2 [number] [-s]
bdiff - file2 [number] [-s]
bdiff file1 - [number] [-s]
The bdiff command compares file1 and file2 and writes information about their differing lines to standard output. If either filename is -
(dash), bdiff reads standard input.
OPTIONS
Suppresses error messages. (May either precede or follow the number argument if it is specified.)
DESCRIPTION
The bdiff command uses diff to find lines that must be changed in two files to make them identical (see the diff command). Its primary
purpose is to permit processing of files that are too large for diff.
The bdiff command ignores lines common to the beginning of both files, splits the remainders into sections of number lines, and runs diff
on the sections. The output is then processed to make it look as if diff had processed the files whole.
If you do not specify number, a system default is used. In some cases, the number you specify or the default number may be too large for
diff. If bdiff fails, specify a smaller value for number and try again.
Note that because of file segmenting, bdiff does not necessarily find the smallest possible set of file differences. In general, although
the output is similar, using bdiff is not the equivalent of using diff.
NOTES
The diff command is executed by a child process, generated by forking, and communicates with bdiff through pipes.
It should not normally be necessary to use this command, since diff can handle most large files.
EXIT STATUS
No differences. Differences found. An error occurred.
SEE ALSO
Commands: diff(1), diff3(1)
bdiff(1)