Skip to main content

All Questions

Tagged with
0 votes
1 answer
44 views

Force Patch character differences to a file

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 vote
1 answer
78 views

How to display line differences between 2 files while considering "modified lines"?

I have 2 files file1 and file2 that are sorted and contain mostly similar lines. I want to display added/modified/suppressed lines between these 2 files. The catch is in the definition of a "...
mido's user avatar
  • 11
0 votes
2 answers
2k views

how to compare all files inside ONE directory in bash?

example given: dir1/ file1 file2 file3 file4 how do you compare file1-file2, file1-file3, file1-file4 then file2->file3, file2->file4 and so on. In this case the name is file_number, but ...
AlexPixel's user avatar
  • 320
0 votes
1 answer
2k views

How do I check the result of a command for an output vs no output in zsh if statement?

I would like to compare 2 files using diff and then if it returns nothing then echo "no diff" else display the difference. My current if statement only works if there is no difference but if there is ...
ntruter42's user avatar
  • 197
0 votes
1 answer
643 views

Can I use `diff` to display not the different but the matching parts?

man diff says: diff - compare files line by line So diff will compare the files. However, eventually, it will show the difference, if there is any. How can I compare the files and show the matching ...
finefoot's user avatar
  • 3,504
3 votes
1 answer
745 views

How to generate (git) diffs with <n> characters of context?

The --unified=<n> option lets you set the number of lines; is there a way to do the same for characters? example limit the context around the changes to X character(s) when using git diff --...
Knu's user avatar
  • 31
0 votes
1 answer
499 views

Comparing IP info between two files based on criteria and outputting the results to two different files [duplicate]

I have a file called "knownIP". This file contain known IP addresses for a group of windows servers. These IP addresses are unique to this group of windows servers. I have another file called "...
ITguru1's user avatar
  • 13
-2 votes
6 answers
7k views

How can I compare two files line by line?

I have two files A and B which are almost same with some lines different and with some lines jumbled. Since the two files are systemverilog files the lines also contain special characters like ; , = + ...
Narasimhan's user avatar
4 votes
2 answers
2k views

Bash Script for showing difference between two text files

Lets say I have two lists: guests-2016.txt: Peter Michael Frank Dirk guests-2017.txt: Mark Michael Dirk Lilly How may I create two new lists of guests Guests that were in guests-2016.txt but are ...
NoobieNoob's user avatar
-1 votes
2 answers
474 views

Exact difference between data of rows in two files in Linux

Need exact output of difference between two files. Data was in rows separated by comma and there was number of rows, for example I have shown you only one row. Each string should look for every string ...
sam's user avatar
  • 11
2 votes
3 answers
2k views

How can I compare different files without opening them?

I have two directories A and B; each one contains a lot of sub-directories geom001, geom002 ....etc each sub-directory contains a file named results. I want to compare, without opening any of them, ...
Mohsen El-Tahawy's user avatar
-3 votes
4 answers
2k views

Comparing 2 files

I have the need via a script to compare 2 files contents and if the contents are different then execute another script however is the contents are the same do nothing. I've tried using the DIFF ...
Brian's user avatar
  • 5
0 votes
1 answer
266 views

Compare a certain lines from multiple documents

I want to compare a certain lines in a multiple documents. I tried using diff and comm, but the conditions are these, the documents are in a different working directory/folder, I could use a wildcard ...
marco guidolla's user avatar
8 votes
5 answers
2k views

Compare two URL lists and print newly added URLs to a new file

I am initially producing two files which contain lists of URLs—I will refer to them as old and new. I would like to compare the two files and if there are any URLs in the new file which are not in the ...
neilH's user avatar
  • 433
1 vote
2 answers
3k views

remove lines from an output file from diff

I have a script that uses diff -c then puts the output on a text file. What I want is to remove the line that does not have the "!" and display the lines with the exclamation mark. Is this possible? ...
midnight27's user avatar

15 30 50 per page