Making diff even better

I was using diff option -y  on Linux to compare two files side by side,  but it did not display the fill width of the window.

diff -W $(( $(tput cols) - 2 )) -y file1 file2 |less

solved it.

It went from being like|AL   ||DE|IN   ||DE|DE   <|DE   <|DE   <
"ClientHello": {        "ClientHello": {

to|ALL|01|main|2021-01-29 16:39:00.297 GMT|Si   ||DEBUG|01|main|2021-01-29 16:39:15.405 GMT||INFO|01|main|2021-01-29 16:39:00.297 GMT|A   ||DEBUG|01|main|2021-01-29 16:39:15.407 GMT||DEBUG|01|main|2021-01-29 16:39:00.297 GMT|   <|DEBUG|01|main|2021-01-29 16:39:00.298 GMT|   <|DEBUG|01|main|2021-01-29 16:39:00.299 GMT|   <
"ClientHello": {                                                "ClientHello": {
  "client version"      : "TLSv1.2",                              "client version"      : "TLSv1.2",

diff -W $(( 120))…. used a terminal width of 120 or each section 60 wide.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s