I'd like to get the missing files that are in file1 but not in file2 within each directory that is similar to ls -sR
output. I show below the format of file1 and file2 and to the right, the expected output. I file1 and file2 is present desktop.ini
but it has different size in both files, so appears in output. The content of file1 and file2 were obtained in 2 different devices and currently my option is to compare by using these files.
file1.txt | file2.txt | Missing files in file1 but not in file2
==========================================================================================================
./AB/FTP: | ./AB/FTP: | ./AB/FTP:
4 FileZilla.lnk | 4 FileZilla.lnk | desktop.ini "different in size"
7 desktop.ini | 1 desktop.ini |
| | ./BX/MS Office:
./BX/MS Office: | ./BX/MS Office: | OneNote 2013.lnk
4 Excel 2013.lnk | 4 Excel 2013.lnk | Outlook 2013.lnk
4 OneNote 2013.lnk | 4 PowerPoint 2013.lnk |
4 Outlook 2013.lnk | 4 Word 2013.lnk | ./D/R/Web:
4 PowerPoint 2013.lnk | 1 desktop.ini | Google Chrome.lnk
4 Word 2013.lnk | | Internet Explorer.lnk
1 desktop.ini | | desktop.ini
| |
./D/R/Web: | |
4 Google Chrome.lnk | |
4 Internet Explorer.lnk | |
1 desktop.ini | |
I've tried with diff
but it seems is not the kind of input diff command needs, or I'm not interpreting correctly the output.
$ diff -u file1.txt file2.txt
--- file1.txt 2022-01-22 13:08:54.855275200 -0400
+++ file2.txt 2022-01-22 13:09:05.785816800 -0400
@@ -1,16 +1,9 @@
- ./AB/FTP:
-4 FileZilla.lnk
-7 desktop.ini
-
- ./BX/MS Office:
-4 Excel 2013.lnk
-4 OneNote 2013.lnk
-4 Outlook 2013.lnk
-4 PowerPoint 2013.lnk
-4 Word 2013.lnk
-1 desktop.ini
-
- ./D/R/Web:
-4 Google Chrome.lnk
-4 Internet Explorer.lnk
-1 desktop.ini
\ No newline at end of file
+ ./AB/FTP:
+4 FileZilla.lnk
+1 desktop.ini
+
+ ./BX/MS Office:
+4 Excel 2013.lnk
+4 PowerPoint 2013.lnk
+4 Word 2013.lnk
+1 desktop.ini
\ No newline at end of file
Thanks in advance for any help.