In emacs, we can view two text files side by side.
Is it also possible to do so in some simpler/lighter applications such as
Only viewing, no editing.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
less command by itself cannot do any diff'ing. You can use the
diff -y command to show the diff of 2 files side-by-side and then pipe that into
This will create 2 sample files.
$ seq 100 > 1.txt $ seq 10 100 > 2.txt
Now diff the 2 files:
$ diff -y 1.txt 2.txt | less 1 < 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 10 11 11 12 12 13 13 ...
You can also use
vimdiff in readonly mode,
$ vimdiff -R 1.txt 2.txt
I am not sure if it is possible using less command. However, it is possible using the below command. From here,
pr -m -t one.txt two.txt
One more option that is useful though doesn't display side by side is,
tail -f file1 -f file2