diff question: how to show only missing files
I have a question on using diff. I have two files that contain directory/file listings: d11.lis and d11.lis from a previous day. I am not interested in files that changed, or were added, I just want to see a list of files that are missing on day two.
Any ideas? Thanks in advance. |
Hi,
I would use comm to do this and not diff. Assuming both files are sorted: comm -23 file1 file2 will show entries that are missing in file2. Hope this helps. |
Quote:
|
You're welcome :)
|
Quote:
Actually I think that just comm -3 file1 file2 is what shows entries missing in file2 (that's a -3, not a -23). |
Hi,
Maybe it gives you the results you want, but it doesn't show files that are only missing from day 2 (file2) as stated in your first post. 1 - suppress lines unique to FILE1 2 - suppress lines unique to FILE2 3 - suppress lines that appear in both files Examples: Code:
# cat file1 Anyway, which of these you actually need depends on the actual requirements. Hope this clears things up a bit. |
All times are GMT -5. The time now is 01:05 AM. |