6

I created a backup on an external hard disc. Then I created another backup and copied all files to another external hard disc. I wanted to check with diff if everything was copied:

user@user:/media/user$ diff -r backup backup1
Nur in backup1/home/user: file.xls.
Nur in backup1/home/user: file.zip.

("nur" is German for "only".)

The diff shows two files that are not existing:

user@user:/media/user$ file backup1/home/user/file.xls.
backup1/home/user/file.xls.: cannot open backup1/home/user/file.xls. (No such file or directory)
user@user:/media/user$ file backup1/home/user/file.zip.
backup1/home/user/file.zip.: cannot open backup1/home/user/file.zip. (No such file or directory)

How does it come that diff shows these two files, and how can I fix the output of diff? The filesystem is LUKS on both external hard drives.

9

The output of diff -r with a German locale adds a . to the file.
Files backup1/home/user/file.xls and backup1/home/user/file.zip should exist.

Example:

$ mkdir dir1 dir2
$ touch dir1/foo
$ LANG=de_DE.UTF8 diff -r dir1 dir2
Nur in dir1: foo.
$ diff -r dir1 dir2
Only in dir1: foo
  • Oh i did not thought about that because i got many files with an ending dot... Thank you! – rmac38 Jul 12 at 15:48
  • What a weird feature!  Great discovery! – Scott Jul 13 at 3:06
  • You should submit a bug report about this. Looking through the po directory of diffutils, only the DE translation does append a period to the filename. All european languages end sentences with a period, there's nothing that stringently German about it. In this case, they could just get rid of it like everybody else ;-) – mosvy Jul 13 at 7:07
  • I will do later. Some scripts could break with this dot and German locale. I was used to English locale, too. – rmac38 Jul 13 at 12:00
  • I filled a bug but don't know if this is the right place. Bug number 1 seems not right ;) github.com/Distrotech/diffutils/issues/1 If there is a better place please tell me. – rmac38 Jul 13 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.