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.
1 Answer 1
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– rmac382019年07月12日 15:48:30 +00:00Commented Jul 12, 2019 at 15:48
-
What a weird feature! Great discovery!Scott - Слава Україні– Scott - Слава Україні2019年07月13日 03:06:11 +00:00Commented Jul 13, 2019 at 3:06
-
You should submit a bug report about this. Looking through the
po
directory ofdiffutils
, 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 ;-)user313992– user3139922019年07月13日 07:07:02 +00:00Commented Jul 13, 2019 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– rmac382019年07月13日 12:00:08 +00:00Commented Jul 13, 2019 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– rmac382019年07月13日 13:15:44 +00:00Commented Jul 13, 2019 at 13:15