Questions tagged [diff]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
49 views

count files and folders with diff and dolphin

I used rsync to make a backup of home folder excluding .* folders rsync -avz --exclude '.*' /home/andrea/ /media/andrea/maxtor-Est1000/ I checked with dolphin and diff to see if everything from the ...
CaneRandagio's user avatar
0 votes
0 answers
186 views

Dealing with new config files during a system update: right way to use meld?

I thought about when, during a system update, there is a new config file; let's take this as example (I installed Ubuntu recently, so I didn't still get this prompt): Configuration file `/etc/nscd....
Dave's user avatar
  • 1
0 votes
0 answers
22 views

Get all differences from original installation

I want to know if there is a valid way to get all manual done modifications to all files of an Ubuntu installation (in my case xubuntu 20.04). The installation is completely updated and the diffs also ...
woelfchen42's user avatar
2 votes
0 answers
415 views

Compare different directory images side by side using XnView MP

I am trying to compare two images side by side. This answer suggested XnView MP. It works great when I want to compare two images in a single directory. I select the two images in the browser and then ...
Nagabhushan S N's user avatar
2 votes
2 answers
827 views

Why isn't the diff command working as I expect in this Bash script?

I'm not understanding why the diff command is not working correctly in my script. Can anybody clarify it for me? Here is the bash script: #!/bin/bash SRC="src-folder" DST="dst-folder&...
martin's user avatar
  • 21
-1 votes
1 answer
38 views

Move files of Dir1 which do not exist in Dir2 into a new Dir3

I have the following environment: **DirA** file1 file2 file3 **DirB** file1 file2 file4 Desired output: **DirC** file4 I have seen solutions to similar problems with diff, sed, and xargs, but i ...
nouse's user avatar
  • 101
1 vote
2 answers
189 views

Process substitution with diff and pipes

When checking if a key and crt match I usually compare the hashes of the modulus as so: openssl rsa -noout -modulus -in key.key | openssl md5 openssl x509 -noout -modulus -in crt.crt | openssl md5 ...
Vulkanodox's user avatar
0 votes
0 answers
31 views

How can I diff two files, deleting lines in file1 from file2 [duplicate]

I want to take file1 and remove all the lines that are contained in file2, ideally keeping the filename file1 once done, keeping the unmodified lines of anything remaining. I've tried using diff as ...
wavers's user avatar
  • 1
2 votes
1 answer
71 views

How to transfer diff between two different file formats?

I often find it convenient to edit a document in one file format while storing it in another format. For example, a document can be written down in markdown, converted to a word file and edited there. ...
tinlyx's user avatar
  • 3,210
2 votes
2 answers
1k views

How to find same subfolders in two folders on first level only?

Scenario: 2 main folders, that may have subfolders with the same names (I do not know what names might be duplicated, that's what I am trying to find) the subfolders have MANY other files & ...
jave.web's user avatar
  • 420
1 vote
1 answer
130 views

Cubic install is different than original... why?

Making my first steps in automating the installation of Ubuntu. Found the Cubic package being recommended and I'm trying it out at the moment. One thing I noticed on one of the first runs was that ...
Michael Waterman's user avatar
2 votes
1 answer
835 views

Compare files in directories with different structures and show differences (20.04)

While this may sound like a task that could be accomplished by rsync, diff and the likes, I haven't managed to succeed. AFAIK, these tools take the directory structure into account when comparing the ...
Frozenpick's user avatar
1 vote
1 answer
228 views

When does diff use | in a side by side diff?

in the documentation to diff is said under "Showing Differences Side by Side": ‘|’ The corresponding lines differ, and they are either both complete or both incomplete. What does complete ...
sigbert's user avatar
  • 11
2 votes
1 answer
192 views

ZFS Diff - diff delegated permission is needed

When running zfs diff today as non-root, I got an error: Unable to obtain diffs: The sys_mount privilege or diff delegated permission is needed to execute the diff ioctl Searching diff ...
Timothy C. Quinn's user avatar
9 votes
1 answer
27k views

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 ...
luisito_36's user avatar
0 votes
0 answers
229 views

Bash script for copying only modified files

I have a very large base dir called proj_base containing humongous amount of files and directories. Mostly every day I create a proj_base_ndate and copy contents previous day folder proj_base_n-1date, ...
indr0's user avatar
  • 1
1 vote
2 answers
2k views

How do I compare equality of two files in Ubuntu?

I have two large pkl files. I'm not interested in knowing the comparisons of the contents of two files (as we do for text files with diff, meld or vimdiff). I suspect that they are the same. Their ...
Ahmad's user avatar
  • 612
0 votes
2 answers
821 views

How to keep locally changed configuration files in sync with updated vanilla package versions after "apt-get upgrade"?

I'm maintaining Ubuntu 16.04.6 LTS and Debian 4.9.210-1 systems. When I apt-get upgrade, I often get the notice that my local configuration files have changes to the updated package configuration ...
Abdull's user avatar
  • 482
5 votes
0 answers
236 views

Is it possible to change default diff tool for apt (or maybe it is for shell)?

I'm not sure is it apt or shell setting or is it a setting at all but whenever there is a conflict on a configuration file while doing apt upgrade I'm presented with these options: Y or I : install ...
Rychu's user avatar
  • 483
1 vote
1 answer
1k views

I have a zip file. I extracted it and modified some files. How do I list them?

Basically I'd like to do a diff and list binary-changed files recursively in the folder. I want to avoid cluttering the filesystem so I think this involves some piping. I searched some examples but ...
beppe9000's user avatar
  • 115
0 votes
0 answers
507 views

How to compare two files with without it doing it line-by-line or ignoring words it has already seen before? (Bash Linux)

So I am trying to compare two files. text1.txt and text2.txt and put the difference between the two files in the file text3.txt My issue is that I cannot find a way to make it eighter not check line-...
Bart The Bart's user avatar
0 votes
1 answer
349 views

Is it possible to visually view the differences (changes) of text files while copying them with Caja?

I have two files with the same name in two different folders. I need to copy the text file from source to destination. Usually I use Caja's Extra Pane (accessible by F3) for doing so: I remembered ...
N0rbert's user avatar
  • 99.3k
1 vote
2 answers
126 views

Display changes between old and new server

I am using a headless Linux server in an off-site location and I access it using ssh. I tried upgrading to Ubuntu 18.04 LTS 64bit because of the constant nagging that Ubuntu 14.04 was outdated, yet I ...
Alex's user avatar
  • 21
1 vote
1 answer
2k views

Why is Meld not identifying differences?

Meld is not showing differences. In this minimal example, directories a and b are different, as shown by diff below. $ diff a/ b/ diff a/a.txt b/a.txt 1c1 < a --- > aa Only in b/: b.txt But ...
Joshua Fox's user avatar
  • 2,931
0 votes
3 answers
3k views

Comparing two text files and save the missing

I have two text files: first text file: Hello Hi Hola Bonjour Second text file: Hi Bonjour How can I output the differences between them regardless the line number i.e. I want to save the ...
apoori's user avatar
  • 1
6 votes
1 answer
5k views

Make the `diff` command look only for differences from a specified range of lines

Is there a way to make the diff command look only for differences from a specified range of lines (from from line to to line), instead of the entire file? I am having difficulty trying to find the ...
JAT86's user avatar
  • 223
1 vote
1 answer
582 views

How to configure "flatpak run org.gnome.meld" as git diff.tool and merge.tool

I can't use meld due to a messed up local installation of cairo or else. I've invested some time in it already including reporting the failure as a bug, but the maintainer states that it's not a bug ...
Kalle Richter's user avatar
1 vote
1 answer
89 views

Identical content search between files of different names?

I do not know if it is possible to compare the contents of text files among other files in a second folder. I need the program to only search for matching strings and if it finds them, show both lines ...
MarianoM's user avatar
  • 645
1 vote
0 answers
818 views

Diff side by side output with "|" (incomplete) sign

When I compare two files with just numbers, in addition to < and > signs, I also have | signs at some of the lines. For example, 25746 | ...
mrq's user avatar
  • 123
0 votes
0 answers
3k views

Why does diff in Terminal say "No such file or directory" when the dir. exists?

I am trying to use 'diff' in Terminal in a way that is very similar to half a year ago, but now it doesn't work. I get the "No such file or directory" error even though the directories obviously exist....
Henrik R.'s user avatar
  • 1,039
1 vote
2 answers
996 views

How do you compare two root filesystems - but ignore mount points?

I have rootfs / but within that I have /mnt/another_rootfs which contains a second mounted rootfs. I want to compare the files in them... but when I do somthng like: diff -r / /mnt/another_rootfs I ...
code_fodder's user avatar
11 votes
3 answers
2k views

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, ...
sancho.s ReinstateMonicaCellio's user avatar
1 vote
0 answers
528 views

Binary diff file

bsdiff uses max(17*n,9*n+m) bytes of memory (where n is the size of the old file and m is the size of the new file) according to http://www.daemonology.net/bsdiff/ Is there a lighter (in terms of ...
tfstwbbnb's user avatar
  • 137
2 votes
1 answer
413 views

How to make 'diff' output line-by-line?

I have a seemingly simple question I can't find answer for. Say, I have two files: A B C D and A X Y D When I run diff -U 1000 on these, I get: A -B -C +X +Y D Instead, I'd like to get: A -...
Be Brave Be Like Ukraine's user avatar
2 votes
1 answer
159 views

How to pass 3rd arg to diff which is a call to another program with multiple arguments?

I want to use diff to compare a text file with the output of a program. I realise I can redirect the output of the program to a file and then compare 2 files but was wondering if it is possible to do ...
arcomber's user avatar
  • 173
5 votes
5 answers
6k views

Comparing contents of two files

I have two files containing list of all files paths from two hard drives (supposed to be exactly the same), one of which I think has missing files. Both lists have the file path and size, but the ...
SD_NZ's user avatar
  • 91
3 votes
0 answers
222 views

Kdiff3 works very slowly in 16.04

After installing 16.04 I've noticed that Kdiff3 worked much slower than in 14.04. In 14.04 it worked well with 200MB files and in 16.04 even 2MB files take around 1-2 minutes to process. And 200MB ...
Ivan Smirnov's user avatar
0 votes
0 answers
242 views

using DIFF with a remote system

I would like to get the difference between two directories (not files), lets say dir1 on a local system and dir2 which is located on a remote server. From what I could find on the internet, the "best" ...
Yama's user avatar
  • 31
0 votes
2 answers
811 views

Copy differences between two dirs to a a new dir?

Edited version to a rushed question! When I run diff on two directories ex: $ diff Linux1 Linux2 The output being $ Only in Linux2: COMPLETELYDIFFERENT22.txt I want to the copy that file(not just ...
SimplySimplified's user avatar
-1 votes
1 answer
555 views

How to perform binary diffing and patching with standard Ubuntu (Debian) tools? [closed]

I have two set of binary files (before and after a certain operation), and I need to perform diffing betwen the sets, and patching on the first set in order to obtain the second set. How can I ...
Marcus's user avatar
  • 2,475
3 votes
0 answers
455 views

convert normal diff to unified diff or use normal diff in patch

I have a normal diff file but I can't patch with it. So how can I convert this normal diff to unified diff or patch with normal diff file? Only in /tmp/ns-allinone-2.26/ns-2.26/common: misc.o diff -...
H.Hoang's user avatar
  • 31
6 votes
2 answers
4k views

Simple diff command output

I've seen many examples of the use of the diff command, but none detailing its basic use. Here is the content of the two files I would like to use: cat -A file1.txt a$ b$ c$ d$ cat -A file2.txt b$ c$...
John_Patrick_Mason's user avatar
2 votes
0 answers
250 views

diff - How to make columns line up

I used Unity Tweak Tool to make some changes and I wanted to find out what keys it used for the changes so I dumped the db to a file like this: dconf dump / > altered_settings.ini Then I reset ...
John Slotsky's user avatar
1 vote
5 answers
2k views

compare contents of two text files in ubuntu?

I need to compare the contents of text files (as a whole and not line-wise like diff command) and print out the missing text. Is there a command to do so? Thanks in advance. EDIT: As an example, say ...
samhitha's user avatar
  • 167
7 votes
2 answers
9k views

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 ...
Tulains Córdova's user avatar
1 vote
0 answers
401 views

Meld issue with codification (one file in Chinese chars)

This is odd. Meld has two text files which were generated by the same program on different dates. One comes out fine but the other is unreadable. The issue does not exist in the terminal. I ...
badner's user avatar
  • 153
3 votes
3 answers
8k views

Diff command to compare files which are in first directory only

I have 2 folders whose contents I want to compare. For instance I have folder 1 and folder 2. Folder 2 has a lot of new files + some files same as folder 1 but with some changes in contents of these ...
Reena Parekh's user avatar
1 vote
2 answers
1k views

Exit code "1" on diff command despite getting output

user@mbp$ diff --suppress-common-lines -y file1.txt file2.txt Some output user@mbp$ echo $? 1 user@mbp$ I'm curious why it throws exit code 1 rather 0 if its giving me what I need? I realize ...
jamieg's user avatar
  • 80
15 votes
3 answers
7k views

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 ...
Matifou's user avatar
  • 698
0 votes
0 answers
521 views

vim -d colorscheme

I need a readable colorscheme for vim -d (or vimdiff). My problem is that some lines aren't readable (see picture), white text on yellow background: I tried also the following in ~/.vimrc: if &...
musbach's user avatar
  • 1,445