Vielen Dank für die Antwort.
kB schrieb:
Wie immer lohnt ein Blick in die Manpage.
Das habe ich gemacht bevor ich die Frage gestellt habe, aber anscheinend habe ich etwas triviales und Grundlegendes noch nicht verstanden 🙄 . Doch dazu später... (weiter unten)
Der Auslöser meiner meiner Frage ist folgende Situation:
Ich habe die Verzeichnisstruktur einer ntfs Partition auf eine ext4 Partition kopiert
Die ext4 Partition war vorher leer.
Das folgende diff war erfolgreich und lieferte keine Unterschiede:
root@srv01:/srv/dev-disk-by-label-Daten# diff -rq /srv/dev-disk-by-label-Daten /srv/dev-disk-by-label-DatenHDsrv01/ | tee difftest.txt
Paranoid wie man ist versucht man dann noch du und das habe ich dann nicht verstanden:
du im Quellverzeichnis
root@srv01:/srv/dev-disk-by-label-Daten# du test/ -scb
3048812 test/
3048812 total
du im Zielverzeichnis
root@srv01:/srv/dev-disk-by-label-DatenHDsrvsrv01# du test/ -scb
3102060 test/
3102060 total
Im Zielverseichnis sind mehr Bytes als im Quellverzeichnis. Dies und der Post https://forum.ubuntuusers.de/topic/ordnergroesse-anzeigen-lassen-mit-ls/#post-1070674 hat mich dazu verleitet die Frage zu stellen.
Deine Antwort habe ich nun zum Anlass genommen mir das nochmal genauer an zu sehen. In einem kleinen Unterverzeichnis ist mir nun folgendes aufgefallen:
Quelle:
root@srv01:/srv/dev-disk-by-label-Daten/test/test/FAHRTEN# du -scb
90672 .
90672 total
Ziel:
root@srv01:/srv/dev-disk-by-label-DatenHDsrv01/test/test/FAHRTEN# du -scb
98864 .
98864 total
Quelle (CodeBlockQ):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 | root@srv01:/srv/dev-disk-by-label-Daten/test/test/FAHRTEN# ls -alR
.:
total 4
drwxrwxrwx 1 root root 0 May 27 1999 .
drwxrwxrwx 1 root root 0 May 27 1999 ..
drwxrwxrwx 1 root root 0 May 27 1999 93
drwxrwxrwx 1 root root 4096 May 27 1999 94
./93:
total 0
drwxrwxrwx 1 root root 0 May 27 1999 .
drwxrwxrwx 1 root root 0 May 27 1999 ..
./94:
total 112
drwxrwxrwx 1 root root 4096 May 27 1999 .
drwxrwxrwx 1 root root 0 May 27 1999 ..
-rwxrwxrwx 1 root root 13456 Feb 3 1991 10-12_90.FW2
-rwxrwxrwx 1 root root 6800 Jan 30 1990 10_9O.FW2
-rwxrwxrwx 1 root root 6832 Jan 30 1990 11_90.FW2
-rwxrwxrwx 1 root root 3968 Jan 30 1990 12_90.FW2
-rwxrwxrwx 1 root root 6560 Feb 23 1990 1_90.FW2
-rwxrwxrwx 1 root root 8160 Feb 27 1990 2_90.FW2
-rwxrwxrwx 1 root root 6496 Apr 2 1990 3_90.FW2
-rwxrwxrwx 1 root root 4256 Jun 29 1990 4_90.FW2
-rwxrwxrwx 1 root root 5296 Jun 29 1990 5_90.FW2
-rwxrwxrwx 1 root root 5184 Sep 1 1990 6_90.FW2
-rwxrwxrwx 1 root root 6672 Sep 1 1990 7_90.FW2
-rwxrwxrwx 1 root root 6096 Sep 1 1990 8_90.FW2
-rwxrwxrwx 1 root root 6800 Jan 30 1990 9_90.FW2
|
Zielverzeichnis (CodeblockZ):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 | root@srv01:/srv/dev-disk-by-label-DatenHDsrv01/test/test/FAHRTEN# ls -alR
.:
total 16
drwxrwxrwx 4 root root 4096 May 27 1999 .
drwxrwxrwx 6 root root 4096 May 27 1999 ..
drwxrwxrwx 2 root root 4096 May 27 1999 93
drwxrwxrwx 2 root root 4096 May 27 1999 94
./93:
total 8
drwxrwxrwx 2 root root 4096 May 27 1999 .
drwxrwxrwx 4 root root 4096 May 27 1999 ..
./94:
total 116
drwxrwxrwx 2 root root 4096 May 27 1999 .
drwxrwxrwx 4 root root 4096 May 27 1999 ..
-rwxrwxrwx 1 root root 13456 Feb 3 1991 10-12_90.FW2
-rwxrwxrwx 1 root root 6800 Jan 30 1990 10_9O.FW2
-rwxrwxrwx 1 root root 6832 Jan 30 1990 11_90.FW2
-rwxrwxrwx 1 root root 3968 Jan 30 1990 12_90.FW2
-rwxrwxrwx 1 root root 6560 Feb 23 1990 1_90.FW2
-rwxrwxrwx 1 root root 8160 Feb 27 1990 2_90.FW2
-rwxrwxrwx 1 root root 6496 Apr 2 1990 3_90.FW2
-rwxrwxrwx 1 root root 4256 Jun 29 1990 4_90.FW2
-rwxrwxrwx 1 root root 5296 Jun 29 1990 5_90.FW2
-rwxrwxrwx 1 root root 5184 Sep 1 1990 6_90.FW2
-rwxrwxrwx 1 root root 6672 Sep 1 1990 7_90.FW2
-rwxrwxrwx 1 root root 6096 Sep 1 1990 8_90.FW2
-rwxrwxrwx 1 root root 6800 Jan 30 1990 9_90.FW2
|
Wenn man sich nun im CodeBlockQ und CodeblockZ die Zeilen 16 und 17 anschaut sieht man die Ursache, welche summiert, für die unterschiedliche Größenangabe verantwortlich ist.
Nun meine Fragen:
Wieso werden für "." und ".." überhaupt 4096 Bytes verbraucht?
Wie kann ich bei du die "." und ".." ausschließen? Mit du -s -c -b --exclude="." und du -s -c -b --exclude=".." scheint es nicht zu funktionieren.
Besten Dank schon mal...
Gruß
SH