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
323
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
  • 4,187
159
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.
89
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
  • 20,535
58
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,677
33
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
  • 633
30
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
  • 7,191
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,315
17
votes
2 answers

exit code of diff

If I run diff -q on two files and they are identical, the exit code generated by echo $? is 0; if the files differ, the exit code is 1. Why is that? In what way is the first diff a success and the second a failure? I used the terms "success" and…
DK Bose
  • 44,553
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
  • 766
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,775
15
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,833
13
votes
3 answers

Difference between two directories?

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,967
12
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
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 S
  • 265
  • 2
  • 6
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…
1
2 3 4 5 6 7