LS two folder side by side

Viewed 1066

How do I paste the content of two folders side by side so that output looks like

some_command dir1 dir2

dir1_file1 dir2_file1
dir1_file2 dir2_file2
dir1_file3 dir2_file3
dir1_file4 dir2_file4
3 Answers

You could use sdiff and view the 2 directories side by side like so:

$ sdiff <(ls -1 dir1) <(ls -1 dir2)

Any differences between the 2 directories will be reflected with a < or > depending on which side of the comparison is missing a specific file/sub-directory.

Example

$ sdiff <(ls -1 dir1) <(ls -1 dir2)
alison_krauss                                                   alison_krauss
Bach - Brandenburg Concertos                                  <
band_of_horses                                                  band_of_horses
Barenaked Ladies                                              <
big_star                                                        big_star
bob_seger                                                       bob_seger
Related