Questions tagged [diff]

diff is a file comparison utility that outputs the differences between two files.

It is typically used to show the changes between one version of a file and a former version of the same file. Diff displays the changes made per line for text files. Modern implementations also support binary files.[1][verification needed] The output is called a "diff", or a patch, since the output can be applied with the Unix program patch. The output of similar file comparison utilities are also called a "diff". Like the use of the word for describing the act of searching, the word diff is used in jargon as a verb for calculating any difference.

96 questions
299
votes
4 answers

How do I diff the output of two commands?

I had imagined the simplest way to compare the contents of two similar directories would be something like diff `ls old` `ls new` But I see why this doesn't work; diff is being handed a big long list of files on the command line, rather than two…
Ternary
  • 3,887
  • 4
  • 19
  • 17
158
votes
20 answers

File and directory comparison tool?

I'm looking for something that will compare directories and files like Beyond Compare does for windows. Its mainly for use of source control, but I need to use it for deployment as well.
DevelopingChris
  • 1,695
  • 2
  • 11
  • 7
77
votes
5 answers

Does "diff" exist for images?

You can compare two text files very easy with diff and even better with meld: If you use diff for images, you get an example like this: $ diff zivi-besch.tif zivildienst.tif Binary files zivi-besch.tif and zivildienst.tif differ Here is an…
Martin Thoma
  • 18,749
  • 26
  • 70
  • 97
57
votes
6 answers

Diff reports difference but both lines are the same

I diff-ed 2 files and got 1c1 < 1 --- > 1 Both files contained just "1". How is this different?
Jiew Meng
  • 10,067
  • 26
  • 73
  • 95
29
votes
4 answers

How to diff multiple files across directories?

I am trying to find diffs between all files of same names across two copies of a directory (say a working and a backup). For example, I can diff two files of same name in both: > diff d1/f.cpp d2/f.cpp or I can find differences across the…
ysap
  • 6,851
  • 11
  • 34
  • 37
28
votes
3 answers

Best alternative for WinMerge

I need to compare/diff/merge files in an easy way. In Dark ages when i'm a windows user I would use WinMerge. What alternatives for this are available in Ubuntu? The things I must be able to do: See 2 files line by line next to each other, with the…
Miller
  • 573
  • 1
  • 6
  • 13
18
votes
4 answers

How can I "diff" two files with Nautilus?

I have installed Meld and found out it's a great comparing tool. Unfortunately there is no integration with Nautilus 3.2. This means, I can't right click on files and select an option to open them in Meld for comparison. I have seen in the tools…
bioShark
  • 4,201
  • 8
  • 40
  • 59
15
votes
3 answers

meld shows output in unreadable alphabet (Japanese/Chinese?)

I am using meld to visualise a diff between two files. meld shows the diff output in... something like Japanese or Chinese? Any idea what could happen? A locale issue? What is strange is that when using diff or colordiff in terminal, they work…
Matifou
  • 648
  • 1
  • 7
  • 23
15
votes
5 answers

Difference of two big files

I have "test1.csv" and it contains 200,400,600,800 100,300,500,700 50,25,125,310 and test2.csv and it contains 100,4,2,1,7 200,400,600,800 21,22,23,24,25 50,25,125,310 50,25,700,5 now diff test2.csv test1.csv > result.csv is different than diff…
Lynob
  • 6,615
  • 16
  • 76
  • 108
13
votes
2 answers

Run diff command to compare all files in directory

I have two folders having in theory an identical folder structure and the same files. I wish to check for differences between the two copies in the two folders. I can run diff folder1/file1 folder2/file1 one by one but this is time consuming. Is…
To Do
  • 15,172
  • 12
  • 70
  • 116
13
votes
3 answers

Diffrence between two dirs?

I have two identical folders, but the are not identical(for example Java installation dir). One dir has one extra file and one file has been changed. Is there any easy to use tool to check that or do I have to write complicated bash script for…
UAdapter
  • 17,157
  • 38
  • 78
  • 102
11
votes
3 answers

Compare source code files, ignoring formatting differences (like whitespace, linebreaks, ...)

I am looking for an application that can compare two C++ sources and find the code-meaningful differences (to compare versions which may have been reformatted differently). At the very minimum, something which has the capability for ignoring changes…
9
votes
1 answer

Bluetooth USB dongle 5.0 0a12:0001 doesn't work on Ubuntu 20.04

WIRELESS USB DONGLE - BLUETOOTH USB DONGLE - MINI 5.0 - VERSION 5.48 - 0a12:0001 So lately I bought a Bluetooth USB dongle - model no: MLT-5.0-MiNi I'm using Ubuntu 20.04.1 LTS. 1. After I connected the adapter into USB port, I checked the port…
luisito_36
  • 322
  • 2
  • 5
  • 15
8
votes
2 answers

Is there any command line interactive tool like meld?

I usually work on someone else's code base on a remote system and often need to merge code from two different files. For that I have to pull files to my system and meld it and push it back to the remote system. Is there any better way to do it…
Sunil Shahu
  • 255
  • 2
  • 6
7
votes
2 answers

Show only right side of --side-by-side diff

I don't seem to find a way around this. Is there a one-liner to get only the right side of a diff --side-by-side output? For example: For this: diff --side-by-side file1 file2 I get either of this two types of results: 2 Africa …
Tulains Córdova
  • 1,609
  • 3
  • 20
  • 28
1
2 3 4 5 6 7