Skip to main content

Questions tagged [diff]

diff - Command-line tool to display the differences between two files, or each corresponding file in two directories.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
75 views

I am struggling with understanding how diff and patch are supposed to work. Here's my use case: I use Betterfox user.js config file for my Firefox profile, but I add some overrides to it. I want to ...
Nikita Karamov's user avatar
2 votes
1 answer
229 views

I'm looking for a command that compares binary files. Of course, I know about diff, but it is not very good at binaries. I have two files from a error-prone source (scratched dvd) which should be ...
Gyro Gearloose's user avatar
0 votes
0 answers
54 views

I've experienced total system freeze while checking if files where copied correctly by diff -rq [INTERNAL HDD] [USB HDD] This happened twice, always while running the diff. On the second occasion I ...
Marek Schwarz's user avatar
1 vote
0 answers
71 views

I've asked the question on SO before, but maybe it is better placed here. I'm running on Ubuntu 24.04.1 LTS (X11) and have p4merge installed in version p4v-2024.3.2656785. I'm using p4merge since ...
morecore's user avatar
  • 111
0 votes
1 answer
100 views

I am trying to hack the Linux kernel and added/modified some header files in include/linux. However, when I generate patch file using diff like: diff -uprN -X linux/Documentation/dontdiff \ ...
Kalman's user avatar
  • 3
0 votes
1 answer
485 views

I have two Docker images, each with many layers. I want to compare all the files in teh first image to all the files in the second one, to see what's been changed. I tried taring up the images using ...
Greg Dougherty's user avatar
0 votes
2 answers
126 views

Let's say that in a script, you have a directory $1 and its copy $2 and you'd like to compare the metadata (names, permissions, sizes, full modification dates, …) of the files and directories inside ...
AlMa1r's user avatar
  • 1
0 votes
0 answers
264 views

According to this process substitution can be used to do a SIMPLE diff between local and remote machine. However, I want to use the -qr option in the diff command, i.e., it must be recursive and brief ...
Ajned's user avatar
  • 111
0 votes
1 answer
134 views

I'm trying to synchronize two hard drives. I thought most people who don't want to lose any data and don't use RAID would use such a method so that there would be a well-working GUI. That doesn't seem ...
mYnDstrEAm's user avatar
  • 4,962
0 votes
1 answer
51 views

I would like to check when a file differ inside a backup system using snapshots. I have several folders with the same architecture inside ls -1 .snapshot 4-hourly.2024-04-14_0405 4-hourly.2024-04-...
ppr's user avatar
  • 1,999
0 votes
1 answer
74 views

I am doing diff -rq to check the difference between 2 folders (A and B). I don't want to know if folder A has any new files because that's expected. How do I ensure that this information doesn't come ...
desert_ranger's user avatar
0 votes
1 answer
104 views

I have configured git diff to be a command that calls substitute diff for viewing file differences i.e /usr/bin/vim -dR "$2" "$3" and that doesn't work when I want to create a ...
vfclists's user avatar
  • 7,919
0 votes
1 answer
161 views

Referring to this https://stackoverflow.com/a/31356602, I wrote this code: #!/bin/bash # Define the two strings to compare string1="First string with some random text." string2="Second ...
Gabriele's user avatar
  • 353
0 votes
2 answers
323 views

Is there a way/tool to show differences between two files side by side only highlighting differences in a similar way kdiff3 does that but with a tool that is reasonably fast?A similar question was ...
atapaka's user avatar
  • 675
2 votes
1 answer
1k views

I'm used to meld for editing while seeing an intra-line diff that's updated live in response to edits. One just types in the left or right pane of the window and then save one or both files. I'm ...
Croad Langshan's user avatar
1 vote
0 answers
118 views

It seems diff can do anything comm can do? When should I use comm only but not diff excepting the difference in result format? I guess comm is faster?
tom10271's user avatar
  • 111
2 votes
3 answers
543 views

In a Linux shell, how to compare two directories recursively, and for each pair of files (including symlinks and directories) with the same location (including the name) in the two directories and the ...
AlMa1r's user avatar
  • 1
1 vote
1 answer
843 views

I need to compare two "minimised", very similar JavaScript files. Minimisation means that (among other things) newline and space characters that are not needed for interpretation by a ...
Ned64's user avatar
  • 9,296
0 votes
0 answers
68 views

I tried vim -d <(ffprobe one.mp4 2>&1) <(ffprobe two.mp4 2>&1) to see the difference between the two videos' codecs etc., but vim doesn't show anything when it opens, just an empty ...
user avatar
0 votes
1 answer
128 views

I'm trying to compare text between two versions of a PDF document. I was able to create a diff with pdftotext, format some replacements with perl and colordiff. This output a lot of differences, but ...
snaut's user avatar
  • 101
2 votes
0 answers
49 views

I've observed unexpected behavior (that seems to be a bug) in diff in recent versions of zsh on macOS, the problem is specifically with the -s directive. diff -s lists difference, but it always adds ...
erik's user avatar
  • 21
0 votes
1 answer
894 views

I'm trying a command and when I enter it the first time it tells me: diff: llet: No such file or directory but then when I try it a second time, it works... Is there a reason why? Here's the command: ...
cow's user avatar
  • 81
1 vote
0 answers
180 views

I've created a bash script that Lists the document IDs I've put in an Elastic index, in $liste_ids_lines: a004-événements-examen_individus_localisés_ou_non a020-les_points-leurs_indicateurs-...
Marc Le Bihan's user avatar
0 votes
0 answers
72 views

I'm currently encountering some challenges while working on a bash script in the Linux terminal to perform the following tasks: Compare the values in the third column of two different files line by ...
duduzba's user avatar
0 votes
1 answer
58 views

I have this env file 1.env contents: BARF_BAG=1 then another env file: 2.env contents: BARF_BAG=2 I run comm and diff on the files to see the difference: #!/usr/bin/env bash ( set -e; ...
Alexander Mills's user avatar
0 votes
1 answer
71 views

Using comm I get results that look weird from this: comm -3 <(. "$first_env_file"; env) <(. "$second_env_file"; env) I get something like: AUTH_LP_ACCOUNT_ID=xxx1 ...
Alexander Mills's user avatar
1 vote
1 answer
1k views

I have two env files, let's say x.env and y.env, the order of the variables is different, but the content could be the same but likely different. Is there some tool I could use to diff the variables? ...
Alexander Mills's user avatar
0 votes
1 answer
63 views

Hello, I have an englishStrings.json file and when I make new edits/ additions to it, I need to copy the new changes to all the other language string.json files. Before making any changes to ...
Freezer Fridge's user avatar
-1 votes
1 answer
108 views

I'm trying to do a compare between a config from an old box and a new box to verify Availability and State haven't changed. I have a file that is generated with about a thousand nodes but every node ...
MyWiseGuys's user avatar
0 votes
1 answer
801 views

[ EDIT: Answered my own question. Used unison and some hacky post-processing ( copy-pasted the log output of unison, tweaked it in my text-editor with multi-selection editing, then did some shell ...
dwawlyn's user avatar
  • 23
0 votes
1 answer
51 views

Is there any form of diff that detects matching lines, i.e., lines containing the same text, except for numerical values (decimal, octal, hexadecimal), and then calculates the delta for those numbers, ...
matjes's user avatar
  • 1
4 votes
1 answer
471 views

I am using the command(diff) on macOS. The document says: -s --report-identical-files Causes diff to report files which are the same, which are otherwise not mentioned. ...
ITO Yosei's user avatar
  • 141
1 vote
4 answers
209 views

I am trying to compare two text files but I need to edit them first to ignore certain strings. Here is an example of one text file: Processing Server ABC-123 oracle 10785 1 0 May17 ? 00:...
user575954's user avatar
1 vote
4 answers
185 views

By mistake I appended (>>) rather than overwrote (>) the output from a script that processed thousands of files, but I only did it for about 20 % of the files (I ran 5 parallel instances of ...
d-b's user avatar
  • 2,077
0 votes
1 answer
48 views

I'm comparing two files in vimdiff. For one section of the code in the first file, the same section in the second file has several lines of code added, and then a slightly modified copy of the section ...
wile_e8's user avatar
  • 111
1 vote
1 answer
63 views

Background: I use Obsidian to organize my notes as I study. It's an application which works "on top of" a collection of markdown formatted plain text files and then shows the links and ...
mahela007's user avatar
  • 193
3 votes
1 answer
122 views

diff3 on files finds no difference: $ grep -P '\[\[.*?\]\]' -o intro.tex | sort > A.txt $ grep -P '\[\[.*?\]\]' -o intro.tex | sort | uniq > B.txt $ grep '\\pnum %% \[\[' intro.tex | sed 's/\\...
pmor's user avatar
  • 757
0 votes
1 answer
1k views

I'm using git diff to return the file names of files recently changed and i'm trying to pipe the returned file names into a grep expression that searches each file and returns the files that have &...
X13Theo's user avatar
1 vote
1 answer
3k views

I have 2 directories $ tree dir{1..2} dir1 ├── file1 └── file2 dir2 ├── file1 └── file2 I want to compare all files in dir1 with all files in dir2 using ansible and print differences like this output:...
Sollosa's user avatar
  • 2,009
0 votes
1 answer
319 views

An Example of Unified Format: --- lao 2002-02-21 23:30:39.942229878 -0800 +++ tzu 2002-02-21 23:30:50.442260588 -0800 @@ -1,7 +1,6 @@ -The Way that can be told of is not the eternal Way; -The name ...
Flux's user avatar
  • 3,318
0 votes
0 answers
111 views

There are two files, a and b, with such contents: a apples oranges kiwis carrots b apples kiwis carrots grapefruits Next, I do diff for them: $ diff a b 2d1 < oranges 4a4 > grapefruits After ...
Ilya Loskutov's user avatar
0 votes
0 answers
23 views

I have two sets of files containing ip addresses file 1 1.1.1.1 2.2.2.2 3.3.3.3 file 2 1.1.1.1 2.2.2.2 4.4.4.4 5.5.5.5 I need to compare two file and print the entry present in file 1 but not in ...
user565262's user avatar
0 votes
0 answers
419 views

patch: **** malformed patch at line 225: diff --git the line 225 is this one : diff --git a/files/etc/Compile_info.txt b/files/etc/Compile_info.txt I have a many patches in one file patch and I ...
James78's user avatar
  • 189
2 votes
2 answers
1k views

I want to apply a unified diff from mypatch.diff to stdin and output the result to stdout. So far, I have tried: patch -i mypatch.diff -o - -u originalfile Which successfully applies mypatch.diff and ...
finefoot's user avatar
  • 3,586
-1 votes
1 answer
520 views

this is the scenario. I have File1 and File2 and i like to have the outcome in File3. I'm kind of new to Linux, but so far ive tried to use sort, diff, and comm. but no luck so far. File1.txt File2....
conny's user avatar
  • 1
0 votes
0 answers
122 views

Is there a program out there like mv and cp, which upon conflict automatically shows a diff before asking whether to override the target file? This is such a basic feature in graphical file managers, ...
xeruf's user avatar
  • 651
-1 votes
1 answer
69 views

I have 2 files: File1: DX 100860599215|732512737|00002|40|1|20220105|20220105|20220523|31014280|5892720|36907000|1|20220105|40|20|D| File2 DX 100860599216|732512737|00002|40|1|20220105|20220105|...
prex's user avatar
  • 1
-3 votes
2 answers
1k views

I have two csv files like this; 422174,XN,20.99,2020-09-01,2022-01-20 20:20:28.613+00 421348,SB,21.99,2021-01-26,2022-01-20 20:20:28.613+00 885176,XN,41.80,2021-11-17,2022-01-20 20:20:28.613+00 881751,...
Burak's user avatar
  • 27
-1 votes
1 answer
915 views

I have two csv files like this; 422174,XN,20.99,2020-09-01,2022-01-20 20:20:28.613+00 421348,SB,21.99,2021-01-26,2022-01-20 20:20:28.613+00 885176,XN,41.80,2021-11-17,2022-01-20 20:20:28.613+00 881751,...
Burak's user avatar
  • 27
10 votes
1 answer
1k views

SHORT VERSION (TL;DR) I have 2 small one-line files, seemingly identical : $ cat f1 f2 ./cconv.sh 100 EUR USD ./cconv.sh 100 EUR USD But they are not, there is a 1 byte difference in size : $ ls -l ...
ChennyStar's user avatar
  • 2,019

1
2 3 4 5
12