Friday, January 3, 2020

A Oneliner for grepping character-by-character differences between two files anywhere on filesystem

Long story short:

Install git.
Hit this at command-prompt from within any git repo(can create afreash using `git init`):

 git diff  --no-index --word-diff=color --word-diff-regex=. /path/to/file1 /path/to/file2
Sample Result:



Dear Cybernauts,

Many a times you might have wondered a way to compare 2 files not just word to word but character-by-character, nicely coloured, and easy to spot on minute changes!

Without finding anything easily on the Internet apart from purchasable solutions (such as desktop versions of diffchecker.com..) not worth the pennies, I dug up some manuals and found it worth the effort to document it for the lazyweb. There you go! ^^ 😉(HaCk tHe BuSy-NeSSeS build on top of it!??!!! Use the 'man' if needed!)


~Namaste
🙏

No comments:

Post a Comment

Featured Post

interviewBit Medium: Palindrome Partitioning II

Problem Name:  Palindrome Partitioning II Problem Description : https://www.interviewbit.com/problems/palindrome-partitioning-ii/ Problem Ap...