neue Fragn
This commit is contained in:
1 parent
07dbc01c92
commit
6a8035cced
16 files changed
+3422
-16
No files matched your search
@@ -0,0 +1,221 @@
|
||||
{
|
||||
"$schema": "../schema/questions.schema.json",
|
||||
"format": "lpic-sim-questions",
|
||||
"meta": {
|
||||
"file": "questions_101_set2.json",
|
||||
"brief": "Zweiter Fragensatz zu Topic 101 Systemarchitektur (LPIC-1 101-500, Objectives 5.0)",
|
||||
"author": "Björn Runden <br@runden.de>",
|
||||
"owner": "Björn Runden <br@runden.de>",
|
||||
"assist": "KI-unterstützt (Claude Opus 5.5), geprüft von Björn Runden <br@runden.de>",
|
||||
"version": "0.1.0 (30.10.2026)"
|
||||
},
|
||||
"exam": "lpic1-101",
|
||||
"questions": [
|
||||
{
|
||||
"id": "101.1-004",
|
||||
"objective": "101.1",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl listet die am PCI-Bus erkannten Geräte auf, z. B. Netzwerk- und Grafikkarten?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`lspci`", "correct": true, "explanation": "Liest die PCI-Informationen aus `/sys` bzw. `/proc/bus/pci`; `-k` zeigt zusätzlich den Treiber." },
|
||||
{ "id": "b", "text": "`lsusb`", "correct": false, "explanation": "Listet USB-Geräte." },
|
||||
{ "id": "c", "text": "`lsblk`", "correct": false, "explanation": "Listet Blockgeräte (Platten, Partitionen)." },
|
||||
{ "id": "d", "text": "`lsmod`", "correct": false, "explanation": "Listet geladene Kernelmodule." },
|
||||
{ "id": "e", "text": "`lscpu`", "correct": false, "explanation": "Zeigt Informationen zur CPU-Architektur." }
|
||||
],
|
||||
"explanation": "`lspci -v` ausführlich, `lspci -nn` mit Hersteller- und Geräte-IDs; `lsusb -t` zeigt den USB-Baum.",
|
||||
"references": ["man 8 lspci"]
|
||||
},
|
||||
{
|
||||
"id": "101.1-005",
|
||||
"objective": "101.1",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl (nur der Name) entlädt ein Kernelmodul, **ohne** Abhängigkeiten zu berücksichtigen – das Gegenstück zu `insmod`?",
|
||||
"answers": ["rmmod"],
|
||||
"explanation": "`rmmod` entfernt genau ein Modul; mit Abhängigkeiten entlädt man über `modprobe -r`.",
|
||||
"references": ["man 8 rmmod"]
|
||||
},
|
||||
{
|
||||
"id": "101.1-006",
|
||||
"objective": "101.1",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Das Kernelmodul `nouveau` soll beim Start **nicht** automatisch geladen werden. Wie erreicht man das üblicherweise?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Eine Datei unter `/etc/modprobe.d/` mit der Zeile `blacklist nouveau` anlegen", "correct": true, "explanation": "modprobe wertet die Konfiguration in `/etc/modprobe.d/*.conf` aus; ggf. initramfs neu erzeugen." },
|
||||
{ "id": "b", "text": "`nouveau` in `/etc/modules` eintragen", "correct": false, "explanation": "`/etc/modules` (Debian) listet Module, die beim Start **geladen** werden sollen." },
|
||||
{ "id": "c", "text": "Die Zeile `nouveau` aus `/proc/modules` löschen", "correct": false, "explanation": "`/proc/modules` ist nur eine Laufzeitanzeige und nicht beschreibbar." },
|
||||
{ "id": "d", "text": "`blacklist nouveau` in `/etc/sysctl.conf` eintragen", "correct": false, "explanation": "`sysctl.conf` setzt Kernelparameter unter `/proc/sys`, keine Modulregeln." },
|
||||
{ "id": "e", "text": "`rmmod nouveau` einmal ausführen", "correct": false, "explanation": "Entlädt das Modul nur bis zum nächsten Start." }
|
||||
],
|
||||
"explanation": "Modulparameter setzt man ebenfalls dort: `options <modul> <param>=<wert>`.",
|
||||
"references": ["man 5 modprobe.d"]
|
||||
},
|
||||
{
|
||||
"id": "101.1-007",
|
||||
"objective": "101.1",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zu udev treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "udev legt Gerätedateien unter `/dev` dynamisch an, wenn der Kernel neue Hardware meldet.", "correct": true, "explanation": "udev reagiert auf Kernel-Ereignisse (uevents) und verwaltet `/dev`." },
|
||||
{ "id": "b", "text": "Eigene udev-Regeln legt man unter `/etc/udev/rules.d/` ab.", "correct": true, "explanation": "Regeln dort haben Vorrang vor denen der Pakete unter `/usr/lib/udev/rules.d/` bzw. `/lib/udev/rules.d/`." },
|
||||
{ "id": "c", "text": "udev speichert seine Regeln in `/proc/udev`.", "correct": false, "explanation": "Einen solchen Pfad gibt es nicht." },
|
||||
{ "id": "d", "text": "`udevadm monitor` löscht alle udev-Regeln.", "correct": false, "explanation": "`udevadm monitor` zeigt eintreffende Ereignisse live an." },
|
||||
{ "id": "e", "text": "D-Bus ist das Dateisystem, in dem udev die Gerätedateien anlegt.", "correct": false, "explanation": "D-Bus ist ein Nachrichtensystem zwischen Prozessen; Gerätedateien liegen im devtmpfs unter `/dev`." }
|
||||
],
|
||||
"explanation": "Beispiel einer Regel: feste Namen für Geräte über Attribute wie Seriennummer. `udevadm info` zeigt die Attribute eines Geräts.",
|
||||
"references": ["man 7 udev", "man 8 udevadm"]
|
||||
},
|
||||
{
|
||||
"id": "101.2-005",
|
||||
"objective": "101.2",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Im GRUB-2-Menü soll für **einen** Start ein zusätzlicher Kernel-Parameter gesetzt werden. Was tut man?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Den Eintrag markieren, `e` drücken, die `linux`-Zeile ergänzen und mit Strg+X bzw. F10 starten", "correct": true, "explanation": "Die Änderung gilt nur für diesen Start; nichts wird gespeichert." },
|
||||
{ "id": "b", "text": "`/boot/grub/grub.cfg` bearbeiten und neu starten", "correct": false, "explanation": "Wirkt dauerhaft (bis zur nächsten Neuerzeugung) – und die Datei soll man nicht von Hand ändern." },
|
||||
{ "id": "c", "text": "`c` drücken und `reboot` eingeben", "correct": false, "explanation": "`c` öffnet die GRUB-Kommandozeile; `reboot` startet nur neu." },
|
||||
{ "id": "d", "text": "Im BIOS-Setup den Parameter eintragen", "correct": false, "explanation": "Die Firmware kennt keine Kernel-Parameter." },
|
||||
{ "id": "e", "text": "Nach dem Start `echo param > /proc/cmdline` ausführen", "correct": false, "explanation": "`/proc/cmdline` ist nur lesbar, und der Kernel läuft dann bereits." }
|
||||
],
|
||||
"explanation": "Typische Einmal-Parameter für die Fehlersuche: `systemd.unit=rescue.target`, `nomodeset`, `init=/bin/bash`.",
|
||||
"references": ["info grub"]
|
||||
},
|
||||
{
|
||||
"id": "101.2-006",
|
||||
"objective": "101.2",
|
||||
"type": "fill",
|
||||
"difficulty": 2,
|
||||
"question": "Welcher Kernel-Parameter in der Form `systemd.unit=…` lässt systemd direkt in das Rettungs-Target starten? (vollständiger Parameter)",
|
||||
"answers": ["systemd.unit=rescue.target"],
|
||||
"explanation": "Für eine minimale Notfall-Shell: `systemd.unit=emergency.target`. Klassisch wirken auch `single` bzw. `1`.",
|
||||
"references": ["man 7 kernel-command-line", "man 7 systemd.special"]
|
||||
},
|
||||
{
|
||||
"id": "101.2-007",
|
||||
"objective": "101.2",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Mit welchem Werkzeug zeigt und ändert man unter Linux die **Boot-Einträge der UEFI-Firmware** (z. B. Bootreihenfolge)?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`efibootmgr`", "correct": true, "explanation": "Liest und schreibt die EFI-Variablen; `-v` zeigt Details, `-o` setzt die Reihenfolge." },
|
||||
{ "id": "b", "text": "`mokutil`", "correct": false, "explanation": "Verwaltet Machine Owner Keys für Secure Boot." },
|
||||
{ "id": "c", "text": "`update-initramfs`", "correct": false, "explanation": "Erzeugt die initramfs neu." },
|
||||
{ "id": "d", "text": "`fdisk -l`", "correct": false, "explanation": "Zeigt Partitionstabellen." },
|
||||
{ "id": "e", "text": "`lsblk`", "correct": false, "explanation": "Listet Blockgeräte." }
|
||||
],
|
||||
"explanation": "Bei UEFI startet die Firmware eine `.efi`-Datei von der EFI-Systempartition; die Einträge stehen im NVRAM.",
|
||||
"references": ["man 8 efibootmgr"]
|
||||
},
|
||||
{
|
||||
"id": "101.2-008",
|
||||
"objective": "101.2",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Datei legt bei **SysV-init** den Standard-Runlevel und das Startverhalten fest?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`/etc/inittab`", "correct": true, "explanation": "z. B. `id:3:initdefault:` für Runlevel 3." },
|
||||
{ "id": "b", "text": "`/etc/init.d/`", "correct": false, "explanation": "Verzeichnis mit den Startskripten der Dienste." },
|
||||
{ "id": "c", "text": "`/etc/rc.local`", "correct": false, "explanation": "Lokales Skript, das am Ende des Starts läuft." },
|
||||
{ "id": "d", "text": "`/etc/systemd/system/default.target`", "correct": false, "explanation": "Entspricht dem Standard-Runlevel bei **systemd**." },
|
||||
{ "id": "e", "text": "`/boot/grub/grub.cfg`", "correct": false, "explanation": "Konfiguration des Bootloaders." }
|
||||
],
|
||||
"explanation": "SysV-init: `/etc/inittab` → Skripte in `/etc/rcN.d/` (S = starten, K = beenden), die auf `/etc/init.d/` verlinken.",
|
||||
"references": ["man 5 inittab"]
|
||||
},
|
||||
{
|
||||
"id": "101.2-009",
|
||||
"objective": "101.2",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zur Analyse des Systemstarts treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`journalctl -b -1` zeigt die Meldungen des vorherigen Starts, sofern das Journal persistent gespeichert wird.", "correct": true, "explanation": "Ohne `/var/log/journal` gibt es nur den aktuellen Start." },
|
||||
{ "id": "b", "text": "`systemd-analyze blame` listet Units nach ihrer Startdauer.", "correct": true, "explanation": "Hilft, langsame Dienste zu finden; `systemd-analyze` allein zeigt die Gesamtzeit." },
|
||||
{ "id": "c", "text": "`dmesg` zeigt die Meldungen aller bisherigen Starts.", "correct": false, "explanation": "Der Ring-Buffer enthält nur den laufenden Start." },
|
||||
{ "id": "d", "text": "Der Bootloader wird vom Kernel geladen.", "correct": false, "explanation": "Umgekehrt: Der Bootloader lädt den Kernel." },
|
||||
{ "id": "e", "text": "Die initramfs wird erst nach systemd geladen.", "correct": false, "explanation": "Die initramfs ist vor dem echten Root-Dateisystem aktiv; systemd läuft oft schon in ihr." }
|
||||
],
|
||||
"explanation": "Für klassische Systeme stehen Startmeldungen auch in `/var/log/messages` bzw. `/var/log/syslog`.",
|
||||
"references": ["man 1 systemd-analyze", "man 1 journalctl"]
|
||||
},
|
||||
{
|
||||
"id": "101.3-005",
|
||||
"objective": "101.3",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Der Befehl `runlevel` gibt `N 5` aus. Was bedeutet das?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Es gab keinen vorherigen Runlevel (N); der aktuelle ist 5.", "correct": true, "explanation": "Erstes Feld: vorheriger Runlevel, zweites: aktueller." },
|
||||
{ "id": "b", "text": "Das System startet in 5 Minuten neu.", "correct": false, "explanation": "`runlevel` plant nichts." },
|
||||
{ "id": "c", "text": "Netzwerk ist deaktiviert (N), 5 Benutzer sind angemeldet.", "correct": false, "explanation": "Mit Benutzern oder Netzwerk hat die Ausgabe nichts zu tun." },
|
||||
{ "id": "d", "text": "Der aktuelle Runlevel ist N (normal), der vorherige 5.", "correct": false, "explanation": "Reihenfolge vertauscht; N bedeutet „none“." },
|
||||
{ "id": "e", "text": "Runlevel 5 ist fehlgeschlagen.", "correct": false, "explanation": "Fehler zeigt `runlevel` nicht an." }
|
||||
],
|
||||
"explanation": "Unter systemd wird der Runlevel aus dem aktiven Target abgeleitet (`graphical.target` → 5).",
|
||||
"references": ["man 8 runlevel"]
|
||||
},
|
||||
{
|
||||
"id": "101.3-006",
|
||||
"objective": "101.3",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Mit welchem `systemctl`-Befehl (vollständig) zeigt man das aktuelle **Standard-Target** an?",
|
||||
"answers": ["systemctl get-default"],
|
||||
"explanation": "Gegenstück: `systemctl set-default <target>`.",
|
||||
"references": ["man 1 systemctl"]
|
||||
},
|
||||
{
|
||||
"id": "101.3-007",
|
||||
"objective": "101.3",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl sendet eine Nachricht an die Terminals **aller** angemeldeten Benutzer?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`wall`", "correct": true, "explanation": "write all: liest den Text von stdin oder als Argument." },
|
||||
{ "id": "b", "text": "`write`", "correct": false, "explanation": "Schreibt an **einen** bestimmten Benutzer." },
|
||||
{ "id": "c", "text": "`mesg`", "correct": false, "explanation": "Erlaubt bzw. verbietet den Empfang von Nachrichten am eigenen Terminal." },
|
||||
{ "id": "d", "text": "`logger`", "correct": false, "explanation": "Schreibt ins Systemprotokoll." },
|
||||
{ "id": "e", "text": "`notify`", "correct": false, "explanation": "Kein Standardbefehl für Terminalnachrichten." }
|
||||
],
|
||||
"explanation": "`shutdown` benachrichtigt angemeldete Benutzer ebenfalls per wall.",
|
||||
"references": ["man 1 wall"]
|
||||
},
|
||||
{
|
||||
"id": "101.3-008",
|
||||
"objective": "101.3",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl startet ein systemd-System **sofort neu**?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`systemctl reboot`", "correct": true, "explanation": "Entspricht dem Wechsel zu `reboot.target`; ebenso `reboot` oder `shutdown -r now`." },
|
||||
{ "id": "b", "text": "`systemctl restart`", "correct": false, "explanation": "Startet **Units** neu und erwartet einen Unit-Namen." },
|
||||
{ "id": "c", "text": "`systemctl isolate poweroff.target`", "correct": false, "explanation": "Schaltet das System aus." },
|
||||
{ "id": "d", "text": "`telinit 0`", "correct": false, "explanation": "Runlevel 0 hält bzw. schaltet aus." },
|
||||
{ "id": "e", "text": "`shutdown -h now`", "correct": false, "explanation": "`-h` hält an bzw. schaltet aus." }
|
||||
],
|
||||
"explanation": "Weitere: `systemctl poweroff`, `systemctl halt`, `systemctl suspend`.",
|
||||
"references": ["man 1 systemctl"]
|
||||
},
|
||||
{
|
||||
"id": "101.3-009",
|
||||
"objective": "101.3",
|
||||
"type": "multi",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Zuordnungen der klassischen SysV-Runlevels sind korrekt?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Runlevel 0: System anhalten (halt/poweroff)", "correct": true, "explanation": "`telinit 0` fährt herunter." },
|
||||
{ "id": "b", "text": "Runlevel 6: Neustart", "correct": true, "explanation": "`telinit 6` startet neu." },
|
||||
{ "id": "c", "text": "Runlevel 1: grafischer Mehrbenutzerbetrieb", "correct": false, "explanation": "Runlevel 1 ist der Einzelbenutzermodus." },
|
||||
{ "id": "d", "text": "Runlevel 5: Einzelbenutzermodus", "correct": false, "explanation": "Runlevel 5 ist (bei vielen Distributionen) Mehrbenutzer mit grafischer Anmeldung." },
|
||||
{ "id": "e", "text": "Runlevel 3: Neustart", "correct": false, "explanation": "Runlevel 3 ist Mehrbenutzer ohne grafische Oberfläche." }
|
||||
],
|
||||
"explanation": "Die Bedeutung von 2–5 war distributionsabhängig; 0, 1 und 6 sind überall gleich.",
|
||||
"references": ["man 8 init"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,369 @@
|
||||
{
|
||||
"$schema": "../schema/questions.schema.json",
|
||||
"format": "lpic-sim-questions",
|
||||
"meta": {
|
||||
"file": "questions_102_set2.json",
|
||||
"brief": "Zweiter Fragensatz zu Topic 102 Linux-Installation und Paketverwaltung (LPIC-1 101-500, Objectives 5.0)",
|
||||
"author": "Björn Runden <br@runden.de>",
|
||||
"owner": "Björn Runden <br@runden.de>",
|
||||
"assist": "KI-unterstützt (Claude Opus 5.5), geprüft von Björn Runden <br@runden.de>",
|
||||
"version": "0.1.0 (30.10.2026)"
|
||||
},
|
||||
"exam": "lpic1-101",
|
||||
"questions": [
|
||||
{
|
||||
"id": "102.1-004",
|
||||
"objective": "102.1",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wofür nutzt Linux eine Swap-Partition bzw. Swap-Datei?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Zum Auslagern selten genutzter Speicherseiten bei knappem Arbeitsspeicher (und für den Ruhezustand)", "correct": true, "explanation": "Swap erweitert den virtuellen Speicher; Hibernate schreibt den RAM-Inhalt dorthin." },
|
||||
{ "id": "b", "text": "Zum Ablegen temporärer Dateien statt `/tmp`", "correct": false, "explanation": "Swap enthält kein Dateisystem für Dateien." },
|
||||
{ "id": "c", "text": "Als Sicherungskopie der Partitionstabelle", "correct": false, "explanation": "Die GPT-Sicherung liegt am Plattenende, nicht im Swap." },
|
||||
{ "id": "d", "text": "Zum Starten des Kernels", "correct": false, "explanation": "Kernel und initramfs liegen in `/boot`." },
|
||||
{ "id": "e", "text": "Als Cache für Paketdownloads", "correct": false, "explanation": "Paket-Caches liegen unter `/var/cache`." }
|
||||
],
|
||||
"explanation": "Aktive Swap-Bereiche zeigen `swapon --show` und `free -h`.",
|
||||
"references": ["man 8 swapon"]
|
||||
},
|
||||
{
|
||||
"id": "102.1-005",
|
||||
"objective": "102.1",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Warum legt man `/boot` häufig auf eine **eigene, unverschlüsselte** Partition?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Damit der Bootloader Kernel und initramfs lesen kann, auch wenn das Root-Dateisystem verschlüsselt ist oder in LVM/RAID liegt", "correct": true, "explanation": "Die initramfs entschlüsselt bzw. aktiviert dann das eigentliche Root-Dateisystem." },
|
||||
{ "id": "b", "text": "Weil `/boot` die Benutzerdaten enthält", "correct": false, "explanation": "Benutzerdaten liegen in `/home`." },
|
||||
{ "id": "c", "text": "Weil `/boot` ständig wächst und das Root-Dateisystem füllen würde", "correct": false, "explanation": "`/boot` ist klein und wächst kaum." },
|
||||
{ "id": "d", "text": "Weil Swap in `/boot` liegen muss", "correct": false, "explanation": "Swap ist ein eigener Bereich." },
|
||||
{ "id": "e", "text": "Weil `/boot` immer XFS sein muss", "correct": false, "explanation": "Dafür gibt es keine solche Vorgabe; üblich ist ext4." }
|
||||
],
|
||||
"explanation": "Bei UEFI kommt zusätzlich die EFI-Systempartition (FAT) hinzu.",
|
||||
"references": ["man 7 hier"]
|
||||
},
|
||||
{
|
||||
"id": "102.1-006",
|
||||
"objective": "102.1",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Unter welchem Pfad wird die EFI-Systempartition üblicherweise eingehängt?",
|
||||
"answers": ["/boot/efi", "/efi"],
|
||||
"explanation": "Dort liegen z. B. `EFI/debian/grubx64.efi` oder `shimx64.efi`.",
|
||||
"references": ["UEFI-Spezifikation, Abschnitt EFI System Partition"]
|
||||
},
|
||||
{
|
||||
"id": "102.1-007",
|
||||
"objective": "102.1",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Verzeichnisse müssen laut klassischer FHS-Vorgabe auf dem **Root-Dateisystem** liegen und dürfen keine eigene Partition sein?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`/etc`", "correct": true, "explanation": "Konfiguration wird gebraucht, bevor weitere Dateisysteme eingehängt sind (z. B. `/etc/fstab`)." },
|
||||
{ "id": "b", "text": "`/sbin`", "correct": true, "explanation": "Programme wie `mount` und `fsck` müssen beim Start verfügbar sein." },
|
||||
{ "id": "c", "text": "`/home`", "correct": false, "explanation": "Typischer Kandidat für eine eigene Partition." },
|
||||
{ "id": "d", "text": "`/var`", "correct": false, "explanation": "Kann (und sollte oft) eigenständig sein." },
|
||||
{ "id": "e", "text": "`/tmp`", "correct": false, "explanation": "Kann eigene Partition oder tmpfs im RAM sein." }
|
||||
],
|
||||
"explanation": "Ebenso `/bin`, `/lib`, `/dev`. Bei zusammengeführtem `/usr` (usrmerge) sind `/bin`, `/sbin`, `/lib` Links nach `/usr`; dann bindet die initramfs `/usr` früh ein.",
|
||||
"references": ["man 7 hier"]
|
||||
},
|
||||
{
|
||||
"id": "102.2-004",
|
||||
"objective": "102.2",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wie installiert man GRUB 2 in den Bootsektor (MBR) der ersten Festplatte eines BIOS-Systems?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`grub-install /dev/sda`", "correct": true, "explanation": "Ziel ist das ganze Gerät, nicht eine Partition." },
|
||||
{ "id": "b", "text": "`grub-install /dev/sda1`", "correct": false, "explanation": "Installiert in den Bootsektor einer Partition – unüblich und nicht der MBR." },
|
||||
{ "id": "c", "text": "`grub-mkconfig /dev/sda`", "correct": false, "explanation": "`grub-mkconfig` erzeugt nur die Konfiguration." },
|
||||
{ "id": "d", "text": "`update-grub /dev/sda`", "correct": false, "explanation": "`update-grub` schreibt nur `grub.cfg`." },
|
||||
{ "id": "e", "text": "`dd if=/boot/grub of=/dev/sda`", "correct": false, "explanation": "`/boot/grub` ist ein Verzeichnis; so zerstört man im schlimmsten Fall die Platte." }
|
||||
],
|
||||
"explanation": "Bei UEFI: `grub-install --target=x86_64-efi --efi-directory=/boot/efi`.",
|
||||
"references": ["man 8 grub-install"]
|
||||
},
|
||||
{
|
||||
"id": "102.2-005",
|
||||
"objective": "102.2",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Variable in `/etc/default/grub` legt fest, wie viele Sekunden das GRUB-Menü wartet?",
|
||||
"answers": ["GRUB_TIMEOUT"],
|
||||
"explanation": "Nach Änderung `update-grub` bzw. `grub-mkconfig -o …` ausführen. `GRUB_DEFAULT` legt den Standardeintrag fest.",
|
||||
"references": ["info grub (Simple configuration)"]
|
||||
},
|
||||
{
|
||||
"id": "102.2-006",
|
||||
"objective": "102.2",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Was bezeichnet `(hd0,1)` in **GRUB 2**?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Die erste Partition der ersten Festplatte", "correct": true, "explanation": "GRUB 2 zählt Platten ab 0, Partitionen ab 1." },
|
||||
{ "id": "b", "text": "Die zweite Partition der ersten Festplatte", "correct": false, "explanation": "So wäre es bei GRUB Legacy (Partitionen ab 0)." },
|
||||
{ "id": "c", "text": "Die erste Partition der zweiten Festplatte", "correct": false, "explanation": "Die zweite Platte wäre `hd1`." },
|
||||
{ "id": "d", "text": "Die ganze erste Festplatte", "correct": false, "explanation": "Das wäre `(hd0)`." },
|
||||
{ "id": "e", "text": "Das CD-Laufwerk", "correct": false, "explanation": "Optische Laufwerke heißen meist `(cd)`." }
|
||||
],
|
||||
"explanation": "Oft mit Tabellentyp: `(hd0,gpt1)` bzw. `(hd0,msdos1)`.",
|
||||
"references": ["info grub (Device syntax)"]
|
||||
},
|
||||
{
|
||||
"id": "102.2-007",
|
||||
"objective": "102.2",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Wo trägt man bei GRUB 2 **dauerhaft** zusätzliche Kernel-Parameter für alle Einträge ein?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "In `GRUB_CMDLINE_LINUX` bzw. `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`, danach `update-grub`", "correct": true, "explanation": "`grub-mkconfig` übernimmt die Werte in jede `linux`-Zeile." },
|
||||
{ "id": "b", "text": "Direkt in `/boot/grub/grub.cfg`", "correct": false, "explanation": "Wird bei der nächsten Neuerzeugung überschrieben." },
|
||||
{ "id": "c", "text": "In `/proc/cmdline`", "correct": false, "explanation": "Nur lesbar und nur die Anzeige des laufenden Starts." },
|
||||
{ "id": "d", "text": "In `/etc/sysctl.conf`", "correct": false, "explanation": "Setzt Laufzeitparameter (`/proc/sys`), keine Boot-Parameter." },
|
||||
{ "id": "e", "text": "In `/etc/modprobe.d/`", "correct": false, "explanation": "Optionen für Kernelmodule, keine Kernel-Befehlszeile." }
|
||||
],
|
||||
"explanation": "`GRUB_CMDLINE_LINUX_DEFAULT` gilt nur für normale Einträge, nicht für den Recovery-Modus.",
|
||||
"references": ["info grub (Simple configuration)"]
|
||||
},
|
||||
{
|
||||
"id": "102.3-003",
|
||||
"objective": "102.3",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Umgebungsvariable nennt zusätzliche Verzeichnisse, in denen der dynamische Linker **vorrangig** nach Shared Libraries sucht?",
|
||||
"answers": ["LD_LIBRARY_PATH"],
|
||||
"explanation": "Mehrere Pfade durch `:` getrennt. Für Programme mit SUID wird sie aus Sicherheitsgründen ignoriert.",
|
||||
"references": ["man 8 ld.so"]
|
||||
},
|
||||
{
|
||||
"id": "102.3-004",
|
||||
"objective": "102.3",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "In welcher Datei legt `ldconfig` den Cache der bekannten Shared Libraries ab?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`/etc/ld.so.cache`", "correct": true, "explanation": "Binärer Cache, den der dynamische Linker beim Programmstart liest." },
|
||||
{ "id": "b", "text": "`/etc/ld.so.conf`", "correct": false, "explanation": "Konfiguration der zusätzlichen Suchpfade." },
|
||||
{ "id": "c", "text": "`/etc/ld.so.preload`", "correct": false, "explanation": "Liste von Bibliotheken, die jedem Programm vorab geladen werden." },
|
||||
{ "id": "d", "text": "`/lib64/ld-linux-x86-64.so.2`", "correct": false, "explanation": "Das ist der dynamische Linker selbst." },
|
||||
{ "id": "e", "text": "`/proc/ld`", "correct": false, "explanation": "Diesen Pfad gibt es nicht." }
|
||||
],
|
||||
"explanation": "Bibliotheksnamen: `libname.so.<version>` (soname), dazu Symlinks; `ldconfig` pflegt sie.",
|
||||
"references": ["man 8 ldconfig"]
|
||||
},
|
||||
{
|
||||
"id": "102.4-006",
|
||||
"objective": "102.4",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wie installiert man die heruntergeladene Datei `tool_1.2_amd64.deb` mit dpkg?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`dpkg -i tool_1.2_amd64.deb`", "correct": true, "explanation": "`-i` (install) installiert bzw. aktualisiert aus der Datei." },
|
||||
{ "id": "b", "text": "`dpkg -x tool_1.2_amd64.deb`", "correct": false, "explanation": "`-x` entpackt nur den Inhalt in ein Verzeichnis." },
|
||||
{ "id": "c", "text": "`dpkg -c tool_1.2_amd64.deb`", "correct": false, "explanation": "`-c` listet den Inhalt." },
|
||||
{ "id": "d", "text": "`dpkg -I tool_1.2_amd64.deb`", "correct": false, "explanation": "`-I` zeigt Informationen (control) zur Datei." },
|
||||
{ "id": "e", "text": "`dpkg -r tool_1.2_amd64.deb`", "correct": false, "explanation": "`-r` entfernt ein installiertes Paket." }
|
||||
],
|
||||
"explanation": "dpkg löst keine Abhängigkeiten auf; fehlende Pakete holt anschließend `apt-get install -f`. Mit apt direkt: `apt install ./tool_1.2_amd64.deb`.",
|
||||
"references": ["man 1 dpkg"]
|
||||
},
|
||||
{
|
||||
"id": "102.4-007",
|
||||
"objective": "102.4",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Mit welchem `apt-cache`-Aufruf (Befehl und Unterbefehl, ohne Suchbegriff) durchsucht man Paketnamen und -beschreibungen nach einem Stichwort?",
|
||||
"answers": ["apt-cache search"],
|
||||
"explanation": "Beispiel: `apt-cache search webserver`. Details zu einem Paket: `apt-cache show <paket>`.",
|
||||
"references": ["man 8 apt-cache"]
|
||||
},
|
||||
{
|
||||
"id": "102.4-008",
|
||||
"objective": "102.4",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Nach `dpkg -i` meldet dpkg fehlende Abhängigkeiten. Welcher Befehl installiert sie nach und schließt die Installation ab?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`apt-get install -f`", "correct": true, "explanation": "`-f` (fix-broken) installiert fehlende Abhängigkeiten aus den Quellen." },
|
||||
{ "id": "b", "text": "`dpkg --configure -a`", "correct": false, "explanation": "Konfiguriert entpackte Pakete, lädt aber keine fehlenden Pakete." },
|
||||
{ "id": "c", "text": "`apt-get update`", "correct": false, "explanation": "Aktualisiert nur die Paketlisten." },
|
||||
{ "id": "d", "text": "`apt-get autoclean`", "correct": false, "explanation": "Löscht veraltete .deb-Dateien aus dem Cache." },
|
||||
{ "id": "e", "text": "`apt-get check`", "correct": false, "explanation": "Prüft nur auf Probleme, behebt nichts." }
|
||||
],
|
||||
"explanation": "`apt-get install -f` ohne Paketnamen versucht, das System in einen konsistenten Zustand zu bringen.",
|
||||
"references": ["man 8 apt-get"]
|
||||
},
|
||||
{
|
||||
"id": "102.4-009",
|
||||
"objective": "102.4",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Zeile ist ein gültiger Eintrag in `/etc/apt/sources.list`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`deb http://deb.debian.org/debian bookworm main`", "correct": true, "explanation": "Typ, URI, Distribution (Suite), Komponente(n)." },
|
||||
{ "id": "b", "text": "`http://deb.debian.org/debian deb bookworm main`", "correct": false, "explanation": "Der Typ `deb` bzw. `deb-src` steht am Anfang." },
|
||||
{ "id": "c", "text": "`repo=http://deb.debian.org/debian`", "correct": false, "explanation": "Das ist keine sources.list-Syntax." },
|
||||
{ "id": "d", "text": "`deb bookworm main http://deb.debian.org/debian`", "correct": false, "explanation": "Die URI steht direkt nach dem Typ." },
|
||||
{ "id": "e", "text": "`[main] baseurl=http://deb.debian.org/debian`", "correct": false, "explanation": "Ähnelt yum-Repo-Dateien, nicht apt." }
|
||||
],
|
||||
"explanation": "Neueres Format: `*.sources`-Dateien (deb822) unter `/etc/apt/sources.list.d/` mit `Types:`, `URIs:`, `Suites:`, `Components:`.",
|
||||
"references": ["man 5 sources.list"]
|
||||
},
|
||||
{
|
||||
"id": "102.4-010",
|
||||
"objective": "102.4",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Mit welchen Befehlen sieht man die **Abhängigkeiten** eines Debian-Pakets aus den Paketquellen?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`apt-cache depends nginx`", "correct": true, "explanation": "Listet Depends, Recommends, Conflicts usw." },
|
||||
{ "id": "b", "text": "`apt-cache show nginx`", "correct": true, "explanation": "Zeigt die Paketbeschreibung inklusive Feld `Depends:`." },
|
||||
{ "id": "c", "text": "`dpkg -L nginx`", "correct": false, "explanation": "Listet die Dateien eines installierten Pakets." },
|
||||
{ "id": "d", "text": "`apt-get download nginx`", "correct": false, "explanation": "Lädt nur die .deb-Datei herunter." },
|
||||
{ "id": "e", "text": "`apt-get autoremove nginx`", "correct": false, "explanation": "Entfernt nicht mehr benötigte Abhängigkeiten." }
|
||||
],
|
||||
"explanation": "Umgekehrte Richtung (wer hängt von X ab): `apt-cache rdepends <paket>`.",
|
||||
"references": ["man 8 apt-cache"]
|
||||
},
|
||||
{
|
||||
"id": "102.4-011",
|
||||
"objective": "102.4",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Was bedeutet der Status `ii` am Zeilenanfang der Ausgabe von `dpkg -l`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Gewünscht: installieren, tatsächlich: installiert", "correct": true, "explanation": "Erstes Zeichen = gewünschter Zustand, zweites = aktueller Zustand." },
|
||||
{ "id": "b", "text": "Entfernt, aber Konfigurationsdateien vorhanden", "correct": false, "explanation": "Das ist `rc`." },
|
||||
{ "id": "c", "text": "Installation abgebrochen, Paket defekt", "correct": false, "explanation": "Das zeigt z. B. `iU` (unpacked) oder `iF` (half-configured)." },
|
||||
{ "id": "d", "text": "Paket ist zur Aktualisierung vorgemerkt", "correct": false, "explanation": "Ein solcher Status steht nicht in den ersten beiden Zeichen." },
|
||||
{ "id": "e", "text": "Paket ist nicht bekannt", "correct": false, "explanation": "Unbekannte Pakete erscheinen gar nicht oder als `un`." }
|
||||
],
|
||||
"explanation": "Installierte Pakete zählen: `dpkg -l | grep '^ii' | wc -l`.",
|
||||
"references": ["man 1 dpkg-query"]
|
||||
},
|
||||
{
|
||||
"id": "102.5-006",
|
||||
"objective": "102.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher dnf-Befehl sucht Pakete anhand eines Stichworts in Name und Beschreibung?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`dnf search nginx`", "correct": true, "explanation": "Durchsucht Namen und Zusammenfassungen in den Repositories." },
|
||||
{ "id": "b", "text": "`dnf info nginx`", "correct": false, "explanation": "Zeigt Details zu einem bekannten Paket." },
|
||||
{ "id": "c", "text": "`dnf provides nginx`", "correct": false, "explanation": "Sucht, welches Paket eine Datei oder Fähigkeit bereitstellt." },
|
||||
{ "id": "d", "text": "`dnf check-update`", "correct": false, "explanation": "Listet verfügbare Aktualisierungen." },
|
||||
{ "id": "e", "text": "`dnf history`", "correct": false, "explanation": "Zeigt vergangene Transaktionen." }
|
||||
],
|
||||
"explanation": "Die meisten Unterbefehle funktionieren gleich mit `yum`.",
|
||||
"references": ["man 8 dnf"]
|
||||
},
|
||||
{
|
||||
"id": "102.5-007",
|
||||
"objective": "102.5",
|
||||
"type": "fill",
|
||||
"difficulty": 2,
|
||||
"question": "Mit welchem dnf-Unterbefehl (Befehl und Unterbefehl, ohne Argument) findet man heraus, welches Paket eine Datei wie `/usr/bin/dig` bereitstellt – auch wenn es nicht installiert ist?",
|
||||
"answers": ["dnf provides", "dnf whatprovides", "yum provides", "yum whatprovides"],
|
||||
"explanation": "Für installierte Pakete genügt `rpm -qf`; `provides` durchsucht die Repositories.",
|
||||
"references": ["man 8 dnf"]
|
||||
},
|
||||
{
|
||||
"id": "102.5-008",
|
||||
"objective": "102.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wo liegen bei yum bzw. dnf die Definitionen der Paket-Repositories?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "In `*.repo`-Dateien unter `/etc/yum.repos.d/`", "correct": true, "explanation": "Abschnitte mit `[id]`, `name=`, `baseurl=` bzw. `metalink=`, `enabled=`, `gpgcheck=`." },
|
||||
{ "id": "b", "text": "In `/etc/apt/sources.list`", "correct": false, "explanation": "Das ist apt (Debian)." },
|
||||
{ "id": "c", "text": "In `/var/lib/rpm/`", "correct": false, "explanation": "Dort liegt die RPM-Datenbank der installierten Pakete." },
|
||||
{ "id": "d", "text": "In `/etc/zypp/repos.d/`", "correct": false, "explanation": "Das ist zypper (openSUSE)." },
|
||||
{ "id": "e", "text": "In `/etc/rpmrc`", "correct": false, "explanation": "Allgemeine rpm-Einstellungen, keine Repositories." }
|
||||
],
|
||||
"explanation": "Globale Einstellungen: `/etc/dnf/dnf.conf` bzw. `/etc/yum.conf`. Repos auflisten: `dnf repolist`.",
|
||||
"references": ["man 5 yum.conf", "man 5 dnf.conf"]
|
||||
},
|
||||
{
|
||||
"id": "102.5-009",
|
||||
"objective": "102.5",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "`rpm -V openssh-server` gibt die Zeile `S.5....T. c /etc/ssh/sshd_config` aus. Was bedeutet sie?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Größe, Prüfsumme und Änderungszeit der Konfigurationsdatei weichen vom Paketstand ab.", "correct": true, "explanation": "`S` Größe, `5` Digest, `T` mtime; `c` kennzeichnet eine Konfigurationsdatei." },
|
||||
{ "id": "b", "text": "Die Datei fehlt.", "correct": false, "explanation": "Fehlende Dateien meldet rpm mit `missing`." },
|
||||
{ "id": "c", "text": "Nur die Rechte der Datei wurden geändert.", "correct": false, "explanation": "Rechteänderungen zeigt `M` an der zweiten Stelle." },
|
||||
{ "id": "d", "text": "Das Paket ist beschädigt und muss neu installiert werden.", "correct": false, "explanation": "Angepasste Konfigurationsdateien sind normal." },
|
||||
{ "id": "e", "text": "Die Signatur des Pakets ist ungültig.", "correct": false, "explanation": "Signaturen prüft `rpm -K paket.rpm`." }
|
||||
],
|
||||
"explanation": "Ein Punkt bedeutet „Test bestanden“. Weitere Zeichen: `U` Eigentümer, `G` Gruppe, `L` Linkziel.",
|
||||
"references": ["man 8 rpm (Abschnitt VERIFY OPTIONS)"]
|
||||
},
|
||||
{
|
||||
"id": "102.5-010",
|
||||
"objective": "102.5",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zu zypper treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`zypper install nano` installiert das Paket samt Abhängigkeiten.", "correct": true, "explanation": "Kurzform `zypper in nano`." },
|
||||
{ "id": "b", "text": "`zypper refresh` aktualisiert die Metadaten der Repositories.", "correct": true, "explanation": "Kurzform `zypper ref`; entspricht `apt-get update`." },
|
||||
{ "id": "c", "text": "`zypper search nano` installiert alle Treffer.", "correct": false, "explanation": "`search` sucht nur." },
|
||||
{ "id": "d", "text": "`zypper repos` löscht alle Repositories.", "correct": false, "explanation": "`repos` (`lr`) listet sie; entfernen: `removerepo`." },
|
||||
{ "id": "e", "text": "zypper verwaltet Debian-Pakete.", "correct": false, "explanation": "zypper arbeitet mit RPM-Paketen (openSUSE, SLES)." }
|
||||
],
|
||||
"explanation": "Weitere: `zypper update`, `zypper remove`, `zypper addrepo`, `zypper what-provides`.",
|
||||
"references": ["man 8 zypper"]
|
||||
},
|
||||
{
|
||||
"id": "102.5-011",
|
||||
"objective": "102.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wie entfernt man das installierte Paket `nano` direkt mit rpm?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`rpm -e nano`", "correct": true, "explanation": "`-e` (erase) entfernt das Paket; abhängige Pakete verhindern das." },
|
||||
{ "id": "b", "text": "`rpm -r nano`", "correct": false, "explanation": "rpm kennt `-r` nicht zum Entfernen." },
|
||||
{ "id": "c", "text": "`rpm -U nano`", "correct": false, "explanation": "`-U` aktualisiert aus einer Paketdatei." },
|
||||
{ "id": "d", "text": "`rpm -qe nano`", "correct": false, "explanation": "Keine gültige Kombination." },
|
||||
{ "id": "e", "text": "`rpm -d nano`", "correct": false, "explanation": "`-d` gehört zu Abfragen (Dokumentationsdateien, `-qd`)." }
|
||||
],
|
||||
"explanation": "Mit Abhängigkeitsauflösung: `dnf remove nano`.",
|
||||
"references": ["man 8 rpm"]
|
||||
},
|
||||
{
|
||||
"id": "102.6-003",
|
||||
"objective": "102.6",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was unterscheidet einen Linux-**Container** grundlegend von einer virtuellen Maschine?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Container teilen sich den Kernel des Hosts; eine VM bringt einen eigenen Kernel auf virtueller Hardware mit.", "correct": true, "explanation": "Container isolieren Prozesse über Namespaces und cgroups." },
|
||||
{ "id": "b", "text": "Container benötigen immer einen Hypervisor vom Typ 1.", "correct": false, "explanation": "Container brauchen gar keinen Hypervisor." },
|
||||
{ "id": "c", "text": "In einem Container läuft stets ein anderes Betriebssystem als Linux.", "correct": false, "explanation": "Linux-Container nutzen den Linux-Kernel des Hosts." },
|
||||
{ "id": "d", "text": "VMs starten schneller, weil sie keinen Kernel laden.", "correct": false, "explanation": "VMs booten einen eigenen Kernel; Container starten meist schneller." },
|
||||
{ "id": "e", "text": "Container haben keinen Zugriff auf Netzwerk.", "correct": false, "explanation": "Container haben normalerweise eigene virtuelle Netzwerkschnittstellen." }
|
||||
],
|
||||
"explanation": "Begriffe aus 102.6: Systemcontainer (vollständiges Userland) und Anwendungscontainer (einzelne Anwendung).",
|
||||
"references": ["man 7 namespaces", "man 7 cgroups"]
|
||||
},
|
||||
{
|
||||
"id": "102.6-004",
|
||||
"objective": "102.6",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zur Virtualisierung treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Paravirtualisierte Treiber (z. B. virtio) verbessern die I/O-Leistung von Gästen.", "correct": true, "explanation": "Der Gast weiß, dass er virtualisiert läuft, und spricht mit dem Hypervisor über effiziente Schnittstellen." },
|
||||
{ "id": "b", "text": "Ein Hypervisor vom Typ 1 läuft direkt auf der Hardware.", "correct": true, "explanation": "Beispiele: Xen, KVM (als Teil des Linux-Kernels), ESXi. Typ 2 läuft auf einem Host-Betriebssystem." },
|
||||
{ "id": "c", "text": "Jeder Container enthält einen eigenen Kernel.", "correct": false, "explanation": "Container nutzen den Kernel des Hosts." },
|
||||
{ "id": "d", "text": "cloud-init läuft auf dem Hypervisor und konfiguriert alle Gäste von außen.", "correct": false, "explanation": "cloud-init läuft **im** Gast beim ersten Start." },
|
||||
{ "id": "e", "text": "Ohne Gasterweiterungen kann eine VM nicht starten.", "correct": false, "explanation": "Gasterweiterungen verbessern Leistung und Integration, sind aber nicht nötig." }
|
||||
],
|
||||
"explanation": "In VMs zeigt `systemd-detect-virt` die erkannte Virtualisierung an.",
|
||||
"references": ["man 1 systemd-detect-virt"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,713 @@
|
||||
{
|
||||
"$schema": "../schema/questions.schema.json",
|
||||
"format": "lpic-sim-questions",
|
||||
"meta": {
|
||||
"file": "questions_103_set2.json",
|
||||
"brief": "Zweiter Fragensatz zu Topic 103 GNU- und Unix-Befehle (LPIC-1 101-500, Objectives 5.0)",
|
||||
"author": "Björn Runden <br@runden.de>",
|
||||
"owner": "Björn Runden <br@runden.de>",
|
||||
"assist": "KI-unterstützt (Claude Opus 5.5), geprüft von Björn Runden <br@runden.de>",
|
||||
"version": "0.1.0 (30.10.2026)"
|
||||
},
|
||||
"exam": "lpic1-101",
|
||||
"questions": [
|
||||
{
|
||||
"id": "103.1-007",
|
||||
"objective": "103.1",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wie öffnet man die Manpage zum **Dateiformat** von `/etc/passwd` statt zum Befehl `passwd`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`man 5 passwd`", "correct": true, "explanation": "Abschnitt 5 enthält Dateiformate und Konventionen." },
|
||||
{ "id": "b", "text": "`man passwd`", "correct": false, "explanation": "Zeigt den ersten Treffer – meist Abschnitt 1, den Befehl." },
|
||||
{ "id": "c", "text": "`man 1 passwd`", "correct": false, "explanation": "Abschnitt 1 sind Benutzerbefehle." },
|
||||
{ "id": "d", "text": "`man -k passwd`", "correct": false, "explanation": "Sucht nur in den Kurzbeschreibungen (wie `apropos`)." },
|
||||
{ "id": "e", "text": "`man 8 passwd`", "correct": false, "explanation": "Abschnitt 8 sind Administrationsbefehle." }
|
||||
],
|
||||
"explanation": "Wichtige Abschnitte: 1 Befehle, 2 Systemaufrufe, 3 Bibliotheksfunktionen, 4 Gerätedateien, 5 Dateiformate, 7 Verschiedenes, 8 Administration.",
|
||||
"references": ["man 1 man"]
|
||||
},
|
||||
{
|
||||
"id": "103.1-008",
|
||||
"objective": "103.1",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl (nur der Name) durchsucht die Kurzbeschreibungen aller Manpages nach einem Stichwort – gleichwertig zu `man -k`?",
|
||||
"answers": ["apropos"],
|
||||
"explanation": "Die Datenbank dafür pflegt `mandb`. `whatis` zeigt die Kurzbeschreibung zu einem exakten Namen.",
|
||||
"references": ["man 1 apropos"]
|
||||
},
|
||||
{
|
||||
"id": "103.1-009",
|
||||
"objective": "103.1",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was bewirkt `cd -` in der Bash?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Wechsel in das vorherige Arbeitsverzeichnis (`$OLDPWD`)", "correct": true, "explanation": "Praktisch zum Hin- und Herspringen; der neue Pfad wird ausgegeben." },
|
||||
{ "id": "b", "text": "Wechsel in das Home-Verzeichnis", "correct": false, "explanation": "Das macht `cd` ohne Argument oder `cd ~`." },
|
||||
{ "id": "c", "text": "Wechsel in das übergeordnete Verzeichnis", "correct": false, "explanation": "Das macht `cd ..`." },
|
||||
{ "id": "d", "text": "Wechsel in das Wurzelverzeichnis", "correct": false, "explanation": "Das macht `cd /`." },
|
||||
{ "id": "e", "text": "Fehlermeldung, da `-` kein Verzeichnis ist", "correct": false, "explanation": "`-` hat bei `cd` eine eigene Bedeutung." }
|
||||
],
|
||||
"explanation": "Das aktuelle Verzeichnis steht in `$PWD` bzw. wird mit `pwd` ausgegeben.",
|
||||
"references": ["help cd"]
|
||||
},
|
||||
{
|
||||
"id": "103.1-010",
|
||||
"objective": "103.1",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Ausgabe erzeugt `echo \"Pfad: $HOME\"` für die Benutzerin `anna` mit dem Home-Verzeichnis `/home/anna`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`Pfad: /home/anna`", "correct": true, "explanation": "In doppelten Anführungszeichen wird `$HOME` ersetzt; die Anführungszeichen selbst erscheinen nicht." },
|
||||
{ "id": "b", "text": "`Pfad: $HOME`", "correct": false, "explanation": "So wäre es mit einfachen Anführungszeichen." },
|
||||
{ "id": "c", "text": "`\"Pfad: /home/anna\"`", "correct": false, "explanation": "Die Shell entfernt die Anführungszeichen vor der Übergabe an `echo`." },
|
||||
{ "id": "d", "text": "`Pfad:`", "correct": false, "explanation": "`HOME` ist gesetzt, also wird ein Wert eingesetzt." },
|
||||
{ "id": "e", "text": "Eine Fehlermeldung", "correct": false, "explanation": "Der Befehl ist korrekt." }
|
||||
],
|
||||
"explanation": "Reihenfolge der Verarbeitung: Quoting erkennen → Expansionen → Anführungszeichen entfernen → Befehl ausführen.",
|
||||
"references": ["man 1 bash (Abschnitt QUOTING)"]
|
||||
},
|
||||
{
|
||||
"id": "103.1-011",
|
||||
"objective": "103.1",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Im aktuellen Verzeichnis existiert eine Datei `axb`. Welche Befehle geben trotzdem genau den Text `a*b` aus?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`echo 'a*b'`", "correct": true, "explanation": "In einfachen Anführungszeichen findet kein Globbing statt." },
|
||||
{ "id": "b", "text": "`echo a\\*b`", "correct": true, "explanation": "Der Backslash maskiert den Stern." },
|
||||
{ "id": "c", "text": "`echo a*b`", "correct": false, "explanation": "Das Muster passt auf `axb` – ausgegeben wird `axb`." },
|
||||
{ "id": "d", "text": "`echo $(a*b)`", "correct": false, "explanation": "Befehlsersetzung: Die Shell versucht `axb` als Befehl auszuführen." },
|
||||
{ "id": "e", "text": "`echo {a*b}`", "correct": false, "explanation": "Ohne Komma keine Klammererweiterung; das Muster `{a*b}` trifft nichts, ausgegeben wird `{a*b}` mit Klammern." }
|
||||
],
|
||||
"explanation": "Auch `echo \"a*b\"` funktioniert: In doppelten Anführungszeichen gibt es kein Globbing.",
|
||||
"references": ["man 1 bash (Abschnitt Pathname Expansion)"]
|
||||
},
|
||||
{
|
||||
"id": "103.1-012",
|
||||
"objective": "103.1",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Mit welcher Tastenkombination durchsucht man in der Bash die History **rückwärts interaktiv**?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Strg+R", "correct": true, "explanation": "reverse-i-search; erneutes Strg+R springt zum nächsten älteren Treffer." },
|
||||
{ "id": "b", "text": "Strg+C", "correct": false, "explanation": "Bricht den laufenden Befehl bzw. die Eingabe ab (SIGINT)." },
|
||||
{ "id": "c", "text": "Strg+D", "correct": false, "explanation": "Dateiende (EOF); in einer leeren Zeile beendet es die Shell." },
|
||||
{ "id": "d", "text": "Strg+Z", "correct": false, "explanation": "Hält den Vordergrundprozess an (SIGTSTP)." },
|
||||
{ "id": "e", "text": "Strg+L", "correct": false, "explanation": "Leert den Bildschirm." }
|
||||
],
|
||||
"explanation": "Pfeil hoch/runter blättert durch die History, `history` listet sie nummeriert.",
|
||||
"references": ["man 1 bash (Abschnitt READLINE)"]
|
||||
},
|
||||
{
|
||||
"id": "103.1-013",
|
||||
"objective": "103.1",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl (nur der Name) gibt den absoluten Pfad des aktuellen Arbeitsverzeichnisses aus?",
|
||||
"answers": ["pwd"],
|
||||
"explanation": "print working directory; `pwd -P` löst symbolische Links auf.",
|
||||
"references": ["help pwd"]
|
||||
},
|
||||
{
|
||||
"id": "103.2-004",
|
||||
"objective": "103.2",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Eine Datei enthält die Zeilen `10`, `9` und `100`. Welcher Befehl sortiert sie **numerisch** aufsteigend (9, 10, 100)?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`sort -n zahlen.txt`", "correct": true, "explanation": "`-n` vergleicht den Zahlenwert." },
|
||||
{ "id": "b", "text": "`sort zahlen.txt`", "correct": false, "explanation": "Lexikalisch: `10`, `100`, `9`." },
|
||||
{ "id": "c", "text": "`sort -r zahlen.txt`", "correct": false, "explanation": "Lexikalisch absteigend." },
|
||||
{ "id": "d", "text": "`sort -u zahlen.txt`", "correct": false, "explanation": "Entfernt Duplikate, sortiert aber lexikalisch." },
|
||||
{ "id": "e", "text": "`sort -k zahlen.txt`", "correct": false, "explanation": "`-k` erwartet eine Feldangabe." }
|
||||
],
|
||||
"explanation": "Kombinierbar: `sort -t: -k3 -n /etc/passwd` sortiert nach UID.",
|
||||
"references": ["man 1 sort"]
|
||||
},
|
||||
{
|
||||
"id": "103.2-005",
|
||||
"objective": "103.2",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl (nur der Name) gibt eine Datei in umgekehrter Zeilenreihenfolge aus (letzte Zeile zuerst)?",
|
||||
"answers": ["tac"],
|
||||
"explanation": "`tac` ist `cat` rückwärts. Zeichen innerhalb einer Zeile umkehren würde `rev`.",
|
||||
"references": ["man 1 tac"]
|
||||
},
|
||||
{
|
||||
"id": "103.2-006",
|
||||
"objective": "103.2",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl wandelt alle Kleinbuchstaben in `namen.txt` in Großbuchstaben um?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`tr 'a-z' 'A-Z' < namen.txt`", "correct": true, "explanation": "`tr` liest nur von stdin und ersetzt Zeichen der ersten Menge durch die der zweiten." },
|
||||
{ "id": "b", "text": "`tr 'A-Z' 'a-z' < namen.txt`", "correct": false, "explanation": "Umgekehrte Richtung: Groß- zu Kleinbuchstaben." },
|
||||
{ "id": "c", "text": "`tr -d 'a-z' < namen.txt`", "correct": false, "explanation": "`-d` löscht die Kleinbuchstaben." },
|
||||
{ "id": "d", "text": "`tr 'a-z' 'A-Z' namen.txt`", "correct": false, "explanation": "`tr` nimmt keine Dateinamen an; die Datei würde als weitere Zeichenmenge gelesen." },
|
||||
{ "id": "e", "text": "`cut -c A-Z namen.txt`", "correct": false, "explanation": "`cut -c` erwartet Zeichenpositionen." }
|
||||
],
|
||||
"explanation": "Mit Klassen: `tr '[:lower:]' '[:upper:]'`. `tr -s ' '` fasst Leerzeichen zusammen.",
|
||||
"references": ["man 1 tr"]
|
||||
},
|
||||
{
|
||||
"id": "103.2-007",
|
||||
"objective": "103.2",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zu Prüfsummen-Werkzeugen treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`sha256sum datei.iso` berechnet die SHA-256-Prüfsumme der Datei.", "correct": true, "explanation": "Ausgabe: Hash und Dateiname." },
|
||||
{ "id": "b", "text": "`sha256sum -c SHA256SUMS` prüft Dateien gegen eine Liste von Prüfsummen.", "correct": true, "explanation": "Meldet je Datei `OK` oder `FAILED`." },
|
||||
{ "id": "c", "text": "`md5sum` gilt heute als kryptografisch sicher gegen gezielte Manipulation.", "correct": false, "explanation": "MD5 ist gebrochen; für Integrität gegen Angreifer SHA-256/SHA-512 nutzen." },
|
||||
{ "id": "d", "text": "`wc -c` berechnet eine Prüfsumme.", "correct": false, "explanation": "`wc -c` zählt Bytes." },
|
||||
{ "id": "e", "text": "`nl` verschlüsselt eine Datei.", "correct": false, "explanation": "`nl` nummeriert Zeilen." }
|
||||
],
|
||||
"explanation": "Im Objective genannt: `md5sum`, `sha256sum`, `sha512sum`. Weitere Filter: `nl`, `od`, `paste`, `split`, `zcat`, `xzcat`, `bzcat`.",
|
||||
"references": ["man 1 sha256sum"]
|
||||
},
|
||||
{
|
||||
"id": "103.3-007",
|
||||
"objective": "103.3",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl legt `projekt/2026/oktober` an, auch wenn `projekt` und `projekt/2026` noch nicht existieren?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`mkdir -p projekt/2026/oktober`", "correct": true, "explanation": "`-p` (parents) legt fehlende übergeordnete Verzeichnisse mit an und meldet keinen Fehler, wenn sie existieren." },
|
||||
{ "id": "b", "text": "`mkdir projekt/2026/oktober`", "correct": false, "explanation": "Scheitert, wenn ein übergeordnetes Verzeichnis fehlt." },
|
||||
{ "id": "c", "text": "`mkdir -r projekt/2026/oktober`", "correct": false, "explanation": "`mkdir` hat keine Option `-r`." },
|
||||
{ "id": "d", "text": "`touch -d projekt/2026/oktober`", "correct": false, "explanation": "`touch -d` setzt einen Zeitstempel aus einer Datumsangabe." },
|
||||
{ "id": "e", "text": "`cp -r projekt/2026/oktober`", "correct": false, "explanation": "`cp` kopiert und braucht ein Ziel." }
|
||||
],
|
||||
"explanation": "`mkdir -m 750 dir` setzt die Rechte direkt beim Anlegen.",
|
||||
"references": ["man 1 mkdir"]
|
||||
},
|
||||
{
|
||||
"id": "103.3-008",
|
||||
"objective": "103.3",
|
||||
"type": "fill",
|
||||
"difficulty": 2,
|
||||
"question": "Welcher `find`-Test (Option mit Wert) wählt Dateien aus, deren Inhalt vor **weniger als 2 Tagen** geändert wurde?",
|
||||
"answers": ["-mtime -2"],
|
||||
"explanation": "`-mtime n` zählt in 24-Stunden-Einheiten: `-2` weniger als 2, `+2` mehr als 2, `2` genau 2. Minutengenau: `-mmin`.",
|
||||
"references": ["man 1 find"]
|
||||
},
|
||||
{
|
||||
"id": "103.3-009",
|
||||
"objective": "103.3",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Das Verzeichnis `alt` enthält noch Dateien. Welcher Befehl löscht es **samt Inhalt**?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`rm -r alt`", "correct": true, "explanation": "`-r` löscht rekursiv; mit `-f` ohne Rückfragen – vorsichtig verwenden." },
|
||||
{ "id": "b", "text": "`rmdir alt`", "correct": false, "explanation": "`rmdir` löscht nur leere Verzeichnisse." },
|
||||
{ "id": "c", "text": "`rm -d alt`", "correct": false, "explanation": "`-d` löscht nur leere Verzeichnisse." },
|
||||
{ "id": "d", "text": "`unlink alt`", "correct": false, "explanation": "`unlink` entfernt genau eine Datei, keine Verzeichnisse." },
|
||||
{ "id": "e", "text": "`rmdir -p alt`", "correct": false, "explanation": "Entfernt leere Verzeichnisse samt leerer Elternverzeichnisse." }
|
||||
],
|
||||
"explanation": "`rm -i` fragt vor jedem Löschen nach.",
|
||||
"references": ["man 1 rm"]
|
||||
},
|
||||
{
|
||||
"id": "103.3-010",
|
||||
"objective": "103.3",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was passiert bei `gzip bericht.txt`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Es entsteht `bericht.txt.gz`, die Originaldatei wird entfernt.", "correct": true, "explanation": "gzip ersetzt die Datei durch die komprimierte Fassung; `-k` behält das Original." },
|
||||
{ "id": "b", "text": "Es entsteht `bericht.txt.gz`, die Originaldatei bleibt erhalten.", "correct": false, "explanation": "Nur mit `-k` (keep) oder `-c` und Umleitung." },
|
||||
{ "id": "c", "text": "Es entsteht ein tar-Archiv `bericht.tar.gz`.", "correct": false, "explanation": "gzip komprimiert einzelne Dateien und erstellt keine Archive." },
|
||||
{ "id": "d", "text": "Die Datei wird entpackt.", "correct": false, "explanation": "Entpacken: `gunzip` bzw. `gzip -d`." },
|
||||
{ "id": "e", "text": "Die Datei wird in ein ZIP-Archiv gelegt.", "correct": false, "explanation": "ZIP erstellt `zip`." }
|
||||
],
|
||||
"explanation": "Gleiches Verhalten bei `bzip2` (`.bz2`) und `xz` (`.xz`). Lesen ohne Entpacken: `zcat`, `bzcat`, `xzcat`.",
|
||||
"references": ["man 1 gzip"]
|
||||
},
|
||||
{
|
||||
"id": "103.3-011",
|
||||
"objective": "103.3",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Wie erstellt man mit `cpio` ein Archiv aller `.conf`-Dateien unterhalb des aktuellen Verzeichnisses?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`find . -name '*.conf' | cpio -o > conf.cpio`", "correct": true, "explanation": "cpio liest die Dateiliste von stdin; `-o` (copy-out) schreibt das Archiv auf stdout." },
|
||||
{ "id": "b", "text": "`cpio -o *.conf conf.cpio`", "correct": false, "explanation": "cpio nimmt Dateinamen nicht als Argumente, sondern von stdin." },
|
||||
{ "id": "c", "text": "`find . -name '*.conf' | cpio -i > conf.cpio`", "correct": false, "explanation": "`-i` (copy-in) liest ein Archiv und entpackt." },
|
||||
{ "id": "d", "text": "`cpio -c conf.cpio .`", "correct": false, "explanation": "Keine gültige Erstellung eines Archivs." },
|
||||
{ "id": "e", "text": "`tar -cpio conf.cpio *.conf`", "correct": false, "explanation": "Vermischt Optionen von tar und cpio." }
|
||||
],
|
||||
"explanation": "Entpacken: `cpio -idv < conf.cpio`. cpio ist u. a. das Format der initramfs.",
|
||||
"references": ["man 1 cpio"]
|
||||
},
|
||||
{
|
||||
"id": "103.3-012",
|
||||
"objective": "103.3",
|
||||
"type": "multi",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Aussagen zu `touch` treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`touch neu.txt` legt eine leere Datei an, wenn sie noch nicht existiert.", "correct": true, "explanation": "Gängiger Weg, eine leere Datei zu erzeugen." },
|
||||
{ "id": "b", "text": "Bei einer bestehenden Datei aktualisiert `touch` die Zeitstempel.", "correct": true, "explanation": "Zugriffs- und Änderungszeit werden auf jetzt gesetzt (`-a`/`-m` einzeln)." },
|
||||
{ "id": "c", "text": "`touch` leert den Inhalt einer bestehenden Datei.", "correct": false, "explanation": "Der Inhalt bleibt unverändert; leeren z. B. mit `> datei` oder `truncate -s 0`." },
|
||||
{ "id": "d", "text": "`touch` legt Verzeichnisse an.", "correct": false, "explanation": "Verzeichnisse legt `mkdir` an." },
|
||||
{ "id": "e", "text": "`touch` darf nur root verwenden.", "correct": false, "explanation": "Jeder Benutzer mit Schreibrecht im Verzeichnis darf das." }
|
||||
],
|
||||
"explanation": "`touch -d '2026-10-01 12:00' datei` setzt einen bestimmten Zeitstempel.",
|
||||
"references": ["man 1 touch"]
|
||||
},
|
||||
{
|
||||
"id": "103.3-013",
|
||||
"objective": "103.3",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Alle `.log`-Dateien sollen nach `archiv/` verschoben werden; vor dem Überschreiben vorhandener Dateien soll nachgefragt werden. Welcher Befehl leistet das?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`mv -i *.log archiv/`", "correct": true, "explanation": "`-i` (interactive) fragt vor dem Überschreiben." },
|
||||
{ "id": "b", "text": "`mv -f *.log archiv/`", "correct": false, "explanation": "`-f` überschreibt ohne Nachfrage." },
|
||||
{ "id": "c", "text": "`mv -n *.log archiv/`", "correct": false, "explanation": "`-n` überschreibt nie und fragt auch nicht." },
|
||||
{ "id": "d", "text": "`cp -i *.log archiv/`", "correct": false, "explanation": "Kopiert nur, die Originale bleiben." },
|
||||
{ "id": "e", "text": "`mv -u *.log archiv/`", "correct": false, "explanation": "`-u` verschiebt nur, wenn die Quelle neuer ist – ohne Nachfrage." }
|
||||
],
|
||||
"explanation": "Auf demselben Dateisystem benennt `mv` nur um (schnell); über Dateisystemgrenzen wird kopiert und gelöscht.",
|
||||
"references": ["man 1 mv"]
|
||||
},
|
||||
{
|
||||
"id": "103.4-007",
|
||||
"objective": "103.4",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wie nennt man die Konstruktion `cat << ENDE` gefolgt von mehreren Zeilen und einer abschließenden Zeile `ENDE`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Here-Document", "correct": true, "explanation": "Die Zeilen bis zur Endmarke werden dem Befehl als stdin übergeben." },
|
||||
{ "id": "b", "text": "Here-String", "correct": false, "explanation": "Here-String ist `<<< \"text\"` – eine einzelne Zeichenkette." },
|
||||
{ "id": "c", "text": "Pipe", "correct": false, "explanation": "Eine Pipe verbindet stdout und stdin zweier Befehle." },
|
||||
{ "id": "d", "text": "Prozessersetzung", "correct": false, "explanation": "Prozessersetzung ist `<(befehl)`." },
|
||||
{ "id": "e", "text": "Befehlsersetzung", "correct": false, "explanation": "Befehlsersetzung ist `$(befehl)`." }
|
||||
],
|
||||
"explanation": "Mit `<< 'ENDE'` (Endmarke in Anführungszeichen) werden Variablen im Text nicht ersetzt; `<<-` entfernt führende Tabulatoren.",
|
||||
"references": ["man 1 bash (Abschnitt Here Documents)"]
|
||||
},
|
||||
{
|
||||
"id": "103.4-008",
|
||||
"objective": "103.4",
|
||||
"type": "fill",
|
||||
"difficulty": 2,
|
||||
"question": "Welcher Operator übergibt in der Bash eine einzelne Zeichenkette als Standardeingabe, z. B. `bc ___ \"2+3\"`? (nur der Operator)",
|
||||
"answers": ["<<<"],
|
||||
"explanation": "Here-String: `bc <<< \"2+3\"` gibt `5` aus. Gleichwertig: `echo \"2+3\" | bc`.",
|
||||
"references": ["man 1 bash (Abschnitt Here Strings)"]
|
||||
},
|
||||
{
|
||||
"id": "103.4-009",
|
||||
"objective": "103.4",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was bewirkt in der Bash `befehl &> ausgabe.txt`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Standardausgabe und Fehlerausgabe werden in `ausgabe.txt` geschrieben.", "correct": true, "explanation": "Kurzform für `> ausgabe.txt 2>&1`." },
|
||||
{ "id": "b", "text": "Der Befehl läuft im Hintergrund und schreibt nur stdout in die Datei.", "correct": false, "explanation": "`&>` ist eine Umleitung, kein Hintergrundstart." },
|
||||
{ "id": "c", "text": "Nur die Fehlerausgabe wird umgeleitet.", "correct": false, "explanation": "Das wäre `2>`." },
|
||||
{ "id": "d", "text": "Die Ausgabe wird an die Datei angehängt.", "correct": false, "explanation": "`&>` überschreibt; anhängen: `&>>`." },
|
||||
{ "id": "e", "text": "Die Datei wird als Eingabe gelesen.", "correct": false, "explanation": "Eingabe wäre `<`." }
|
||||
],
|
||||
"explanation": "`&>` ist Bash-spezifisch; in POSIX-sh schreibt man `> datei 2>&1`.",
|
||||
"references": ["man 1 bash (Abschnitt REDIRECTION)"]
|
||||
},
|
||||
{
|
||||
"id": "103.4-010",
|
||||
"objective": "103.4",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Die Ausgabe soll auf dem Bildschirm erscheinen und an `log.txt` **angehängt** werden. Welche Zeile ist richtig?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`befehl | tee -a log.txt`", "correct": true, "explanation": "`-a` (append) hängt an, statt zu überschreiben." },
|
||||
{ "id": "b", "text": "`befehl | tee log.txt`", "correct": false, "explanation": "Überschreibt `log.txt`." },
|
||||
{ "id": "c", "text": "`befehl | tee >> log.txt`", "correct": false, "explanation": "`tee` ohne Datei gibt nur auf stdout aus, und das landet per `>>` in der Datei – auf dem Bildschirm erscheint nichts." },
|
||||
{ "id": "d", "text": "`befehl >> log.txt | tee`", "correct": false, "explanation": "stdout geht vollständig in die Datei; `tee` erhält nichts." },
|
||||
{ "id": "e", "text": "`befehl 2>> log.txt`", "correct": false, "explanation": "Hängt nur die Fehlerausgabe an." }
|
||||
],
|
||||
"explanation": "Mehrere Ziele gleichzeitig: `befehl | tee a.txt b.txt`.",
|
||||
"references": ["man 1 tee"]
|
||||
},
|
||||
{
|
||||
"id": "103.4-011",
|
||||
"objective": "103.4",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zu `xargs` treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Mit `-n 1` wird der Befehl für jedes Argument einzeln aufgerufen.", "correct": true, "explanation": "`-n` begrenzt die Argumente pro Aufruf." },
|
||||
{ "id": "b", "text": "Mit `-0` liest xargs durch NUL-Zeichen getrennte Namen, passend zu `find -print0`.", "correct": true, "explanation": "So funktionieren auch Namen mit Leerzeichen oder Zeilenumbrüchen." },
|
||||
{ "id": "c", "text": "xargs liest die Argumente aus einer als Parameter angegebenen Datei, nie von stdin.", "correct": false, "explanation": "Standard ist stdin; eine Datei nur mit `-a`." },
|
||||
{ "id": "d", "text": "xargs ruft den Befehl immer genau einmal pro Eingabezeile auf.", "correct": false, "explanation": "Standardmäßig bündelt xargs möglichst viele Argumente in einem Aufruf." },
|
||||
{ "id": "e", "text": "Mit `-I {}` werden alle geschweiften Klammern aus der Eingabe gelöscht.", "correct": false, "explanation": "`-I {}` legt einen Platzhalter fest, der durch jedes Eingabeelement ersetzt wird." }
|
||||
],
|
||||
"explanation": "Beispiel mit Platzhalter: `ls *.txt | xargs -I {} cp {} /sicherung/`.",
|
||||
"references": ["man 1 xargs"]
|
||||
},
|
||||
{
|
||||
"id": "103.4-012",
|
||||
"objective": "103.4",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Wie leitet man Standardausgabe **und** Fehlerausgabe eines Befehls gemeinsam an `less` weiter?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`befehl 2>&1 | less`", "correct": true, "explanation": "stderr wird vor der Pipe auf stdout gelegt; beides fließt in die Pipe." },
|
||||
{ "id": "b", "text": "`befehl | less 2>&1`", "correct": false, "explanation": "Die Umleitung gilt hier für `less`, nicht für `befehl`." },
|
||||
{ "id": "c", "text": "`befehl 2> | less`", "correct": false, "explanation": "Syntaxfehler: `2>` braucht ein Ziel." },
|
||||
{ "id": "d", "text": "`befehl > less 2>&1`", "correct": false, "explanation": "Schreibt in eine **Datei** namens `less`." },
|
||||
{ "id": "e", "text": "`befehl & less`", "correct": false, "explanation": "Startet `befehl` im Hintergrund und danach `less` ohne Eingabe." }
|
||||
],
|
||||
"explanation": "Bash-Kurzform: `befehl |& less`.",
|
||||
"references": ["man 1 bash (Abschnitt Pipelines)"]
|
||||
},
|
||||
{
|
||||
"id": "103.4-013",
|
||||
"objective": "103.4",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was liefert `cat /dev/null`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Nichts – Lesen ergibt sofort Dateiende.", "correct": true, "explanation": "`/dev/null` verwirft Geschriebenes und liefert beim Lesen nichts." },
|
||||
{ "id": "b", "text": "Endlos Nullbytes", "correct": false, "explanation": "Das liefert `/dev/zero`." },
|
||||
{ "id": "c", "text": "Zufallsdaten", "correct": false, "explanation": "Das liefern `/dev/random` und `/dev/urandom`." },
|
||||
{ "id": "d", "text": "Den Inhalt der zuletzt verworfenen Ausgaben", "correct": false, "explanation": "Verworfenes wird nicht gespeichert." },
|
||||
{ "id": "e", "text": "Eine Fehlermeldung „Permission denied“", "correct": false, "explanation": "`/dev/null` ist für alle les- und schreibbar." }
|
||||
],
|
||||
"explanation": "Praktisch: `cat /dev/null > datei` leert eine Datei, ohne sie zu löschen.",
|
||||
"references": ["man 4 null"]
|
||||
},
|
||||
{
|
||||
"id": "103.5-007",
|
||||
"objective": "103.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl zeigt **alle** Prozesse aller Benutzer mit Benutzer, CPU- und Speicheranteil an?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`ps aux`", "correct": true, "explanation": "BSD-Syntax: `a` alle mit Terminal, `u` benutzerorientiert, `x` auch ohne Terminal." },
|
||||
{ "id": "b", "text": "`ps`", "correct": false, "explanation": "Ohne Optionen nur die Prozesse des aktuellen Terminals." },
|
||||
{ "id": "c", "text": "`jobs`", "correct": false, "explanation": "Zeigt nur Jobs der aktuellen Shell." },
|
||||
{ "id": "d", "text": "`pstree`", "correct": false, "explanation": "Zeigt die Prozesshierarchie ohne CPU- und Speicherwerte." },
|
||||
{ "id": "e", "text": "`free`", "correct": false, "explanation": "Zeigt nur die Speicherbelegung insgesamt." }
|
||||
],
|
||||
"explanation": "Gleichwertig in System-V-Syntax: `ps -ef` (ohne %CPU/%MEM). Fortlaufend: `top` bzw. `htop`.",
|
||||
"references": ["man 1 ps"]
|
||||
},
|
||||
{
|
||||
"id": "103.5-008",
|
||||
"objective": "103.5",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl (nur der Name) stellt laufende Prozesse als Baum ihrer Eltern-Kind-Beziehungen dar?",
|
||||
"answers": ["pstree"],
|
||||
"explanation": "`pstree -p` zeigt zusätzlich die PIDs. Auch `ps -ef --forest` zeigt eine Baumansicht.",
|
||||
"references": ["man 1 pstree"]
|
||||
},
|
||||
{
|
||||
"id": "103.5-009",
|
||||
"objective": "103.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welches Signal veranlasst viele Daemons, ihre **Konfiguration neu einzulesen**, ohne sich zu beenden?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "SIGHUP (1)", "correct": true, "explanation": "Ursprünglich „Terminal aufgelegt“; Daemons ohne Terminal nutzen es als Reload-Signal." },
|
||||
{ "id": "b", "text": "SIGKILL (9)", "correct": false, "explanation": "Beendet den Prozess sofort." },
|
||||
{ "id": "c", "text": "SIGSTOP (19)", "correct": false, "explanation": "Hält den Prozess an." },
|
||||
{ "id": "d", "text": "SIGCONT (18)", "correct": false, "explanation": "Setzt einen angehaltenen Prozess fort." },
|
||||
{ "id": "e", "text": "SIGINT (2)", "correct": false, "explanation": "Unterbrechung, wie Strg+C – Programme beenden sich meist." }
|
||||
],
|
||||
"explanation": "Beispiel: `kill -HUP $(pidof rsyslogd)`. Bei systemd entsprechend `systemctl reload`.",
|
||||
"references": ["man 7 signal"]
|
||||
},
|
||||
{
|
||||
"id": "103.5-010",
|
||||
"objective": "103.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl sendet SIGTERM an **alle** Prozesse mit dem Namen `httpd`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`killall httpd`", "correct": true, "explanation": "`killall` wählt Prozesse nach Namen; ebenso `pkill httpd`." },
|
||||
{ "id": "b", "text": "`kill httpd`", "correct": false, "explanation": "`kill` erwartet PIDs oder Jobspezifikationen." },
|
||||
{ "id": "c", "text": "`pidof -k httpd`", "correct": false, "explanation": "`pidof` gibt nur PIDs aus." },
|
||||
{ "id": "d", "text": "`pgrep -k httpd`", "correct": false, "explanation": "`pgrep` sucht nur; senden würde `pkill`." },
|
||||
{ "id": "e", "text": "`top -k httpd`", "correct": false, "explanation": "`top` hat keine solche Option; im Programm beendet man mit der Taste `k`." }
|
||||
],
|
||||
"explanation": "Anderes Signal: `killall -HUP httpd` bzw. `pkill -HUP httpd`.",
|
||||
"references": ["man 1 killall", "man 1 pkill"]
|
||||
},
|
||||
{
|
||||
"id": "103.5-011",
|
||||
"objective": "103.5",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zur Bedienung von `top` treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Mit der Taste `k` sendet man einem Prozess ein Signal.", "correct": true, "explanation": "top fragt nach PID und Signal (Standard SIGTERM)." },
|
||||
{ "id": "b", "text": "Mit der Taste `q` beendet man top.", "correct": true, "explanation": "quit." },
|
||||
{ "id": "c", "text": "Mit der Taste `r` startet man das System neu.", "correct": false, "explanation": "`r` ändert den Nice-Wert eines Prozesses (renice)." },
|
||||
{ "id": "d", "text": "Mit `M` sortiert top nach PID.", "correct": false, "explanation": "`M` sortiert nach Speicherverbrauch, `P` nach CPU." },
|
||||
{ "id": "e", "text": "Mit `h` wird top im Hintergrund versteckt.", "correct": false, "explanation": "`h` zeigt die Hilfe." }
|
||||
],
|
||||
"explanation": "Nicht interaktiv, z. B. für Skripte: `top -b -n 1`.",
|
||||
"references": ["man 1 top"]
|
||||
},
|
||||
{
|
||||
"id": "103.5-012",
|
||||
"objective": "103.5",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Wie trennt man sich in **GNU screen** von der laufenden Sitzung, ohne sie zu beenden?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Strg+A, dann D", "correct": true, "explanation": "detach; wieder verbinden mit `screen -r`." },
|
||||
{ "id": "b", "text": "Strg+B, dann D", "correct": false, "explanation": "Das ist die Standard-Tastenfolge von **tmux** (wieder verbinden: `tmux attach`)." },
|
||||
{ "id": "c", "text": "Strg+D", "correct": false, "explanation": "Beendet die Shell im Fenster." },
|
||||
{ "id": "d", "text": "Strg+Z", "correct": false, "explanation": "Hält den Vordergrundprozess an." },
|
||||
{ "id": "e", "text": "Strg+C", "correct": false, "explanation": "Unterbricht den laufenden Befehl." }
|
||||
],
|
||||
"explanation": "Laufende Sitzungen auflisten: `screen -ls` bzw. `tmux ls`.",
|
||||
"references": ["man 1 screen", "man 1 tmux"]
|
||||
},
|
||||
{
|
||||
"id": "103.5-013",
|
||||
"objective": "103.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was bewirkt `watch -n 5 df -h`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`df -h` wird alle 5 Sekunden ausgeführt und die Ausgabe im Vollbild aktualisiert.", "correct": true, "explanation": "`-n` legt das Intervall fest (Standard 2 Sekunden); `-d` hebt Änderungen hervor." },
|
||||
{ "id": "b", "text": "`df -h` läuft fünfmal und beendet sich dann.", "correct": false, "explanation": "`watch` läuft, bis man es mit Strg+C beendet." },
|
||||
{ "id": "c", "text": "`df -h` startet in 5 Sekunden einmalig.", "correct": false, "explanation": "Einmalig verzögert wäre `sleep 5; df -h`." },
|
||||
{ "id": "d", "text": "Es überwacht 5 Dateisysteme und alarmiert bei Fehlern.", "correct": false, "explanation": "`watch` alarmiert nicht von selbst." },
|
||||
{ "id": "e", "text": "Es setzt den Nice-Wert von df auf 5.", "correct": false, "explanation": "Das wäre `nice -n 5 df -h`." }
|
||||
],
|
||||
"explanation": "Im Objective 103.5 genannt: `watch`, `screen`, `tmux`, `nohup`, `ps`, `top`, `free`, `uptime`, `pgrep`, `pkill`, `killall`.",
|
||||
"references": ["man 1 watch"]
|
||||
},
|
||||
{
|
||||
"id": "103.6-004",
|
||||
"objective": "103.6",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Geben Sie den Befehl ein, der `./backup.sh` mit dem Nice-Wert 15 startet.",
|
||||
"answers": ["nice -n 15 ./backup.sh", "nice -15 ./backup.sh", "nice --adjustment=15 ./backup.sh", "nice -n 15 backup.sh", "nice -15 backup.sh"],
|
||||
"explanation": "Achtung: Bei `nice -15` ist der Bindestrich die Option, nicht das Vorzeichen; negativ wäre `nice --15` bzw. `nice -n -15`.",
|
||||
"references": ["man 1 nice"]
|
||||
},
|
||||
{
|
||||
"id": "103.6-005",
|
||||
"objective": "103.6",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "In welcher Spalte zeigt `top` den Nice-Wert eines Prozesses?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "NI", "correct": true, "explanation": "NI = nice value (−20 bis 19)." },
|
||||
{ "id": "b", "text": "PR", "correct": false, "explanation": "PR ist die vom Kernel verwendete Priorität (meist 20 + NI)." },
|
||||
{ "id": "c", "text": "S", "correct": false, "explanation": "S ist der Prozesszustand (R, S, D, Z, T)." },
|
||||
{ "id": "d", "text": "RES", "correct": false, "explanation": "Belegter physischer Speicher." },
|
||||
{ "id": "e", "text": "VIRT", "correct": false, "explanation": "Virtueller Speicher." }
|
||||
],
|
||||
"explanation": "In `ps -l` heißen die Spalten ebenfalls `PRI` und `NI`.",
|
||||
"references": ["man 1 top"]
|
||||
},
|
||||
{
|
||||
"id": "103.6-006",
|
||||
"objective": "103.6",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welchen Nice-Wert erhält ein Programm, das mit `nice ./job.sh` (ohne weitere Optionen) gestartet wird?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "10", "correct": true, "explanation": "Ohne Angabe erhöht `nice` den Wert um 10 (ausgehend von 0)." },
|
||||
{ "id": "b", "text": "0", "correct": false, "explanation": "0 ist der Standard ohne `nice`." },
|
||||
{ "id": "c", "text": "19", "correct": false, "explanation": "19 ist der niedrigste mögliche Vorrang, aber nicht der Standard von `nice`." },
|
||||
{ "id": "d", "text": "−10", "correct": false, "explanation": "Negative Werte nur mit Root-Rechten und ausdrücklicher Angabe." },
|
||||
{ "id": "e", "text": "1", "correct": false, "explanation": "Die Standarderhöhung ist 10." }
|
||||
],
|
||||
"explanation": "`nice` ohne Befehl gibt den aktuellen Nice-Wert der Shell aus.",
|
||||
"references": ["man 1 nice"]
|
||||
},
|
||||
{
|
||||
"id": "103.6-007",
|
||||
"objective": "103.6",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Wie setzt root den Nice-Wert **aller** laufenden Prozesse der Benutzerin `anna` auf 5?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`renice -n 5 -u anna`", "correct": true, "explanation": "`-u` wählt alle Prozesse eines Benutzers." },
|
||||
{ "id": "b", "text": "`nice -n 5 -u anna`", "correct": false, "explanation": "`nice` startet neue Befehle und kennt kein `-u`." },
|
||||
{ "id": "c", "text": "`renice -n 5 -p anna`", "correct": false, "explanation": "`-p` erwartet PIDs." },
|
||||
{ "id": "d", "text": "`usermod -n 5 anna`", "correct": false, "explanation": "`usermod` hat keine Nice-Option." },
|
||||
{ "id": "e", "text": "`ulimit -e 5 anna`", "correct": false, "explanation": "`ulimit -e` setzt eine Obergrenze der Priorität für die eigene Shell, nicht für fremde Prozesse." }
|
||||
],
|
||||
"explanation": "Mit `-g` wählt `renice` eine Prozessgruppe.",
|
||||
"references": ["man 1 renice"]
|
||||
},
|
||||
{
|
||||
"id": "103.7-005",
|
||||
"objective": "103.7",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welche grep-Option ignoriert die Groß- und Kleinschreibung?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`-i`", "correct": true, "explanation": "`--ignore-case`." },
|
||||
{ "id": "b", "text": "`-w`", "correct": false, "explanation": "Trifft nur ganze Wörter." },
|
||||
{ "id": "c", "text": "`-x`", "correct": false, "explanation": "Trifft nur ganze Zeilen." },
|
||||
{ "id": "d", "text": "`-c`", "correct": false, "explanation": "Zählt passende Zeilen." },
|
||||
{ "id": "e", "text": "`-h`", "correct": false, "explanation": "Unterdrückt Dateinamen in der Ausgabe." }
|
||||
],
|
||||
"explanation": "Kombinierbar, z. B. `grep -iw error /var/log/syslog`.",
|
||||
"references": ["man 1 grep"]
|
||||
},
|
||||
{
|
||||
"id": "103.7-006",
|
||||
"objective": "103.7",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welche grep-Option (nur die Option) durchsucht Verzeichnisse **rekursiv**?",
|
||||
"answers": ["-r", "-R", "--recursive", "--dereference-recursive"],
|
||||
"explanation": "`-r` folgt symbolischen Links nur auf der Befehlszeile, `-R` allen. Beispiel: `grep -rn PermitRootLogin /etc/ssh/`.",
|
||||
"references": ["man 1 grep"]
|
||||
},
|
||||
{
|
||||
"id": "103.7-007",
|
||||
"objective": "103.7",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Welcher erweiterte reguläre Ausdruck (`grep -E`) passt sowohl auf `color` als auch auf `colour`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`colou?r`", "correct": true, "explanation": "`?` bedeutet: vorheriges Zeichen null- oder einmal." },
|
||||
{ "id": "b", "text": "`colo.r`", "correct": false, "explanation": "`.` verlangt genau ein Zeichen zwischen `colo` und `r` – passt auf `colour`, nicht auf `color`." },
|
||||
{ "id": "c", "text": "`colo[u]r`", "correct": false, "explanation": "Die Klammer verlangt genau ein `u`." },
|
||||
{ "id": "d", "text": "`colo(u)+r`", "correct": false, "explanation": "`+` verlangt mindestens ein `u`." },
|
||||
{ "id": "e", "text": "`^colour$`", "correct": false, "explanation": "Passt nur auf Zeilen, die genau `colour` lauten." }
|
||||
],
|
||||
"explanation": "In Basic RE schreibt man unter GNU grep `colou\\?r`.",
|
||||
"references": ["man 7 regex"]
|
||||
},
|
||||
{
|
||||
"id": "103.7-008",
|
||||
"objective": "103.7",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welche sed-Option ändert die Datei **direkt** (in place), statt das Ergebnis auf stdout auszugeben?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`-i`", "correct": true, "explanation": "`-i.bak` legt zusätzlich eine Sicherung an." },
|
||||
{ "id": "b", "text": "`-n`", "correct": false, "explanation": "Unterdrückt die automatische Ausgabe (zusammen mit `p`)." },
|
||||
{ "id": "c", "text": "`-e`", "correct": false, "explanation": "Leitet ein sed-Skript ein (mehrere `-e` möglich)." },
|
||||
{ "id": "d", "text": "`-E`", "correct": false, "explanation": "Aktiviert erweiterte reguläre Ausdrücke." },
|
||||
{ "id": "e", "text": "`-s`", "correct": false, "explanation": "Behandelt mehrere Dateien getrennt." }
|
||||
],
|
||||
"explanation": "Vor `sed -i` an wichtigen Dateien das Ergebnis ohne `-i` prüfen.",
|
||||
"references": ["man 1 sed"]
|
||||
},
|
||||
{
|
||||
"id": "103.7-009",
|
||||
"objective": "103.7",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was gibt `sed '/^#/d' app.conf` aus?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Den Inhalt von `app.conf` ohne die Zeilen, die mit `#` beginnen", "correct": true, "explanation": "`/muster/d` löscht passende Zeilen aus der Ausgabe; die Datei bleibt unverändert." },
|
||||
{ "id": "b", "text": "Nur die Zeilen, die mit `#` beginnen", "correct": false, "explanation": "Das wäre `sed -n '/^#/p'`." },
|
||||
{ "id": "c", "text": "Nichts – die Datei wird gelöscht", "correct": false, "explanation": "`d` löscht Zeilen aus dem Datenstrom, keine Dateien." },
|
||||
{ "id": "d", "text": "Den Inhalt, wobei jedes `#` durch `d` ersetzt wird", "correct": false, "explanation": "Ersetzen wäre `s/#/d/`." },
|
||||
{ "id": "e", "text": "Nur die erste Zeile", "correct": false, "explanation": "Das wäre `sed -n 1p` bzw. `sed q`." }
|
||||
],
|
||||
"explanation": "Mit Leerzeilen zusammen: `sed -e '/^#/d' -e '/^$/d' app.conf`.",
|
||||
"references": ["man 1 sed"]
|
||||
},
|
||||
{
|
||||
"id": "103.7-010",
|
||||
"objective": "103.7",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zu grep und seinen Varianten treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`grep -c muster datei` gibt die Anzahl passender Zeilen aus.", "correct": true, "explanation": "Pro Datei eine Zahl." },
|
||||
{ "id": "b", "text": "`grep -l muster *.conf` gibt nur die Namen der Dateien mit Treffern aus.", "correct": true, "explanation": "`-L` gibt umgekehrt die Dateien ohne Treffer aus." },
|
||||
{ "id": "c", "text": "`egrep` entspricht `grep -F`.", "correct": false, "explanation": "`egrep` entspricht `grep -E`; `fgrep` entspricht `grep -F`." },
|
||||
{ "id": "d", "text": "`fgrep` wertet reguläre Ausdrücke aus.", "correct": false, "explanation": "`fgrep` sucht feste Zeichenketten ohne Sonderbedeutung." },
|
||||
{ "id": "e", "text": "`grep -o` gibt immer die ganze passende Zeile aus.", "correct": false, "explanation": "`-o` gibt nur den passenden Teil aus." }
|
||||
],
|
||||
"explanation": "`egrep` und `fgrep` gelten als veraltet; besser `grep -E` und `grep -F`.",
|
||||
"references": ["man 1 grep"]
|
||||
},
|
||||
{
|
||||
"id": "103.8-005",
|
||||
"objective": "103.8",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Taste macht in vi im Befehlsmodus die letzte Änderung **rückgängig**?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`u`", "correct": true, "explanation": "undo; in vim wiederholt Strg+R das Rückgängiggemachte." },
|
||||
{ "id": "b", "text": "`x`", "correct": false, "explanation": "Löscht das Zeichen unter dem Cursor." },
|
||||
{ "id": "c", "text": "`p`", "correct": false, "explanation": "Fügt den Pufferinhalt ein." },
|
||||
{ "id": "d", "text": "`r`", "correct": false, "explanation": "Ersetzt ein einzelnes Zeichen." },
|
||||
{ "id": "e", "text": "`.`", "correct": false, "explanation": "Wiederholt die letzte Änderung." }
|
||||
],
|
||||
"explanation": "`U` macht alle Änderungen in der aktuellen Zeile rückgängig.",
|
||||
"references": [":help undo"]
|
||||
},
|
||||
{
|
||||
"id": "103.8-006",
|
||||
"objective": "103.8",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Tastenfolge kopiert in vi im Befehlsmodus die **aktuelle Zeile** in den Puffer (yank)?",
|
||||
"answers": ["yy", "Y"],
|
||||
"explanation": "Mit `p` fügt man sie unterhalb, mit `P` oberhalb ein. `3yy` kopiert drei Zeilen.",
|
||||
"references": [":help yy"]
|
||||
},
|
||||
{
|
||||
"id": "103.8-007",
|
||||
"objective": "103.8",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Welcher Ex-Befehl ersetzt in vi **in der ganzen Datei** jedes Vorkommen von `alt` durch `neu`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`:%s/alt/neu/g`", "correct": true, "explanation": "`%` = alle Zeilen, `g` = alle Vorkommen je Zeile." },
|
||||
{ "id": "b", "text": "`:s/alt/neu/`", "correct": false, "explanation": "Nur das erste Vorkommen in der aktuellen Zeile." },
|
||||
{ "id": "c", "text": "`:%s/alt/neu/`", "correct": false, "explanation": "Ohne `g` nur das erste Vorkommen je Zeile." },
|
||||
{ "id": "d", "text": "`/alt/neu`", "correct": false, "explanation": "Eine Suche nach dem Muster `alt/neu`." },
|
||||
{ "id": "e", "text": "`:g/alt/`", "correct": false, "explanation": "Führt einen Befehl (Standard: ausgeben) für alle passenden Zeilen aus, ersetzt nichts." }
|
||||
],
|
||||
"explanation": "Mit Rückfrage je Treffer: `:%s/alt/neu/gc`.",
|
||||
"references": [":help :substitute"]
|
||||
},
|
||||
{
|
||||
"id": "103.8-008",
|
||||
"objective": "103.8",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wie springt man in vi zur Zeile 42?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`:42`", "correct": true, "explanation": "Ex-Befehl mit Zeilennummer; gleichwertig im Befehlsmodus `42G`." },
|
||||
{ "id": "b", "text": "`42dd`", "correct": false, "explanation": "Löscht 42 Zeilen ab der aktuellen." },
|
||||
{ "id": "c", "text": "`/42`", "correct": false, "explanation": "Sucht nach dem Text „42“." },
|
||||
{ "id": "d", "text": "`42yy`", "correct": false, "explanation": "Kopiert 42 Zeilen." },
|
||||
{ "id": "e", "text": "`G42`", "correct": false, "explanation": "`G` springt ans Dateiende; `42` wäre dann der Beginn eines neuen Befehls." }
|
||||
],
|
||||
"explanation": "`gg` springt an den Anfang, `G` ans Ende. Zeilennummern anzeigen: `:set number`.",
|
||||
"references": [":help G"]
|
||||
},
|
||||
{
|
||||
"id": "103.8-009",
|
||||
"objective": "103.8",
|
||||
"type": "multi",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Aussagen zu Texteditoren unter Linux treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Die Variablen `EDITOR` bzw. `VISUAL` bestimmen den Editor für Programme wie `crontab -e` oder `visudo`.", "correct": true, "explanation": "z. B. `export EDITOR=vim` in `~/.bashrc`." },
|
||||
{ "id": "b", "text": "In vi wechselt man mit der Esc-Taste in den Befehlsmodus.", "correct": true, "explanation": "Aus dem Einfüge- oder Ersetzungsmodus." },
|
||||
{ "id": "c", "text": "`:q` beendet vi auch dann, wenn ungesicherte Änderungen vorliegen.", "correct": false, "explanation": "vi verweigert das; erzwingen mit `:q!`." },
|
||||
{ "id": "d", "text": "`ZZ` verwirft alle Änderungen.", "correct": false, "explanation": "`ZZ` speichert (falls geändert) und beendet." },
|
||||
{ "id": "e", "text": "`vi -R datei` öffnet die Datei mit Root-Rechten.", "correct": false, "explanation": "`-R` öffnet schreibgeschützt (read-only)." }
|
||||
],
|
||||
"explanation": "Im Objective genannt: vi mit `/`, `?`, `h j k l`, `i o a`, `d p y dd yy`, `ZZ :w! :q!`, sowie nano und emacs als Alternativen.",
|
||||
"references": [":help ZZ"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,379 @@
|
||||
{
|
||||
"$schema": "../schema/questions.schema.json",
|
||||
"format": "lpic-sim-questions",
|
||||
"meta": {
|
||||
"file": "questions_104_set2.json",
|
||||
"brief": "Zweiter Fragensatz zu Topic 104 Geräte, Linux-Dateisysteme, FHS (LPIC-1 101-500, Objectives 5.0)",
|
||||
"author": "Björn Runden <br@runden.de>",
|
||||
"owner": "Björn Runden <br@runden.de>",
|
||||
"assist": "KI-unterstützt (Claude Opus 5.5), geprüft von Björn Runden <br@runden.de>",
|
||||
"version": "0.1.0 (30.10.2026)"
|
||||
},
|
||||
"exam": "lpic1-101",
|
||||
"questions": [
|
||||
{
|
||||
"id": "104.1-004",
|
||||
"objective": "104.1",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Auf `/dev/sdb2` soll ein XFS-Dateisystem mit der Bezeichnung (Label) `daten` angelegt werden. Welcher Befehl ist korrekt?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`mkfs.xfs -L daten /dev/sdb2`", "correct": true, "explanation": "`-L` setzt das Label beim Anlegen (max. 12 Zeichen bei XFS)." },
|
||||
{ "id": "b", "text": "`mke2fs -t xfs -L daten /dev/sdb2`", "correct": false, "explanation": "`mke2fs` legt nur ext2/3/4 an." },
|
||||
{ "id": "c", "text": "`xfs_admin -L daten /dev/sdb2`", "correct": false, "explanation": "Ändert das Label eines **bestehenden** XFS; angelegt wird nichts." },
|
||||
{ "id": "d", "text": "`mkfs -t xfs -l daten /dev/sdb2`", "correct": false, "explanation": "Kleines `-l` steht bei mkfs.xfs für Log-Optionen." },
|
||||
{ "id": "e", "text": "`mount -t xfs -L daten /dev/sdb2`", "correct": false, "explanation": "`mount` legt keine Dateisysteme an." }
|
||||
],
|
||||
"explanation": "Labels lassen sich in fstab mit `LABEL=daten` nutzen. ext4: `e2label` bzw. `tune2fs -L`.",
|
||||
"references": ["man 8 mkfs.xfs"]
|
||||
},
|
||||
{
|
||||
"id": "104.1-005",
|
||||
"objective": "104.1",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Mit welchem Befehl (mit Argument) aktiviert man den bereits initialisierten Swap-Bereich `/dev/sdc2`?",
|
||||
"answers": ["swapon /dev/sdc2"],
|
||||
"explanation": "Deaktivieren: `swapoff /dev/sdc2`; aktive Bereiche: `swapon --show`.",
|
||||
"references": ["man 8 swapon"]
|
||||
},
|
||||
{
|
||||
"id": "104.1-006",
|
||||
"objective": "104.1",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Ein USB-Stick soll unter Windows, macOS und Linux nutzbar sein und Dateien **größer als 4 GiB** speichern. Welches Dateisystem passt?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "exFAT", "correct": true, "explanation": "Breit unterstützt und ohne 4-GiB-Grenze je Datei." },
|
||||
{ "id": "b", "text": "VFAT (FAT32)", "correct": false, "explanation": "Breit unterstützt, aber Dateien sind auf knapp 4 GiB begrenzt." },
|
||||
{ "id": "c", "text": "ext4", "correct": false, "explanation": "Windows und macOS lesen ext4 ohne Zusatzsoftware nicht." },
|
||||
{ "id": "d", "text": "XFS", "correct": false, "explanation": "Nur unter Linux nativ nutzbar." },
|
||||
{ "id": "e", "text": "Btrfs", "correct": false, "explanation": "Nur unter Linux nativ nutzbar." }
|
||||
],
|
||||
"explanation": "Anlegen: `mkfs.exfat` bzw. `mkfs.vfat`. Im Objective genannt: ext2/3/4, XFS, VFAT, exFAT, Btrfs (Grundlagen).",
|
||||
"references": ["man 8 mkfs.exfat"]
|
||||
},
|
||||
{
|
||||
"id": "104.1-007",
|
||||
"objective": "104.1",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Merkmale bietet **Btrfs**?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Subvolumes", "correct": true, "explanation": "Eigenständig einhängbare Teilbäume innerhalb eines Dateisystems." },
|
||||
{ "id": "b", "text": "Snapshots", "correct": true, "explanation": "Platzsparende Momentaufnahmen per Copy-on-Write." },
|
||||
{ "id": "c", "text": "Es ist ausschließlich als Swap verwendbar.", "correct": false, "explanation": "Btrfs ist ein vollwertiges Dateisystem." },
|
||||
{ "id": "d", "text": "Es hat keine Prüfsummen für Daten.", "correct": false, "explanation": "Btrfs prüft Daten und Metadaten mit Prüfsummen." },
|
||||
{ "id": "e", "text": "Es ist auf 2 TB Größe begrenzt.", "correct": false, "explanation": "Btrfs unterstützt sehr große Dateisysteme." }
|
||||
],
|
||||
"explanation": "Weitere Merkmale: integrierte RAID-Funktionen, Kompression, Online-Vergrößerung.",
|
||||
"references": ["man 5 btrfs"]
|
||||
},
|
||||
{
|
||||
"id": "104.2-004",
|
||||
"objective": "104.2",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Ein ext4 auf `/dev/sdb1` soll nach spätestens 30 Einhängevorgängen beim Start automatisch geprüft werden. Welcher Befehl stellt das ein?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`tune2fs -c 30 /dev/sdb1`", "correct": true, "explanation": "`-c` setzt die maximale Mount-Anzahl bis zur Prüfung." },
|
||||
{ "id": "b", "text": "`tune2fs -i 30 /dev/sdb1`", "correct": false, "explanation": "`-i` setzt ein Zeitintervall (z. B. `30d`)." },
|
||||
{ "id": "c", "text": "`e2fsck -c 30 /dev/sdb1`", "correct": false, "explanation": "`e2fsck -c` sucht fehlerhafte Blöcke mit `badblocks`." },
|
||||
{ "id": "d", "text": "`dumpe2fs -c 30 /dev/sdb1`", "correct": false, "explanation": "`dumpe2fs` zeigt nur Informationen an." },
|
||||
{ "id": "e", "text": "`mkfs.ext4 -c 30 /dev/sdb1`", "correct": false, "explanation": "Würde ein neues Dateisystem anlegen und alle Daten löschen." }
|
||||
],
|
||||
"explanation": "Aktuelle Werte: `tune2fs -l /dev/sdb1 | grep -i mount`.",
|
||||
"references": ["man 8 tune2fs"]
|
||||
},
|
||||
{
|
||||
"id": "104.2-005",
|
||||
"objective": "104.2",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welche `df`-Option (nur die Option) zeigt statt des Speicherplatzes die Belegung der **Inodes**?",
|
||||
"answers": ["-i", "--inodes"],
|
||||
"explanation": "Viele kleine Dateien können die Inodes erschöpfen, obwohl noch Platz frei ist.",
|
||||
"references": ["man 1 df"]
|
||||
},
|
||||
{
|
||||
"id": "104.2-006",
|
||||
"objective": "104.2",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Welcher Befehl zeigt die Superblock-Informationen eines ext4-Dateisystems an (z. B. Blockgröße, Mount-Zähler, Zustand)?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`dumpe2fs -h /dev/sdb1`", "correct": true, "explanation": "`-h` beschränkt die Ausgabe auf den Superblock; gleichwertig `tune2fs -l`." },
|
||||
{ "id": "b", "text": "`xfs_info /dev/sdb1`", "correct": false, "explanation": "Für XFS-Dateisysteme." },
|
||||
{ "id": "c", "text": "`blkid /dev/sdb1`", "correct": false, "explanation": "Zeigt nur UUID, Typ und Label." },
|
||||
{ "id": "d", "text": "`fsck -N /dev/sdb1`", "correct": false, "explanation": "Zeigt nur, welcher Prüfbefehl ausgeführt würde." },
|
||||
{ "id": "e", "text": "`du -s /dev/sdb1`", "correct": false, "explanation": "Zeigt die Größe der Gerätedatei, nicht des Dateisystems." }
|
||||
],
|
||||
"explanation": "`debugfs` erlaubt interaktive Untersuchung und Reparatur von ext-Dateisystemen – nur für Experten.",
|
||||
"references": ["man 8 dumpe2fs"]
|
||||
},
|
||||
{
|
||||
"id": "104.2-007",
|
||||
"objective": "104.2",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zu `e2fsck` und `fsck` treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`e2fsck -f` erzwingt eine Prüfung, auch wenn das Dateisystem als sauber markiert ist.", "correct": true, "explanation": "Ohne `-f` überspringt e2fsck saubere Dateisysteme." },
|
||||
{ "id": "b", "text": "`e2fsck -n` prüft nur und beantwortet alle Fragen mit „nein“, ändert also nichts.", "correct": true, "explanation": "Sicherer Prüflauf; damit auch an lesend eingehängten Dateisystemen nutzbar." },
|
||||
{ "id": "c", "text": "`fsck -A` prüft nur das Root-Dateisystem.", "correct": false, "explanation": "`-A` prüft alle Dateisysteme aus `/etc/fstab` (in der Reihenfolge des sechsten Felds)." },
|
||||
{ "id": "d", "text": "`xfs_repair` darf auf einem eingehängten XFS laufen.", "correct": false, "explanation": "XFS muss ausgehängt sein; nur `-n` (Prüfung) geht eingeschränkt." },
|
||||
{ "id": "e", "text": "`e2fsck -y` beantwortet alle Fragen mit „nein“.", "correct": false, "explanation": "`-y` beantwortet alle Fragen mit „ja“ und repariert automatisch." }
|
||||
],
|
||||
"explanation": "`-p` (preen) repariert automatisch nur gefahrlose Fehler – so laufen Prüfungen beim Start.",
|
||||
"references": ["man 8 e2fsck", "man 8 fsck"]
|
||||
},
|
||||
{
|
||||
"id": "104.3-005",
|
||||
"objective": "104.3",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was bewirkt die Mount-Option `noexec`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Programme auf diesem Dateisystem können nicht direkt ausgeführt werden.", "correct": true, "explanation": "Das Ausführungsrecht wird ignoriert – nützlich z. B. für `/tmp` oder Wechselmedien." },
|
||||
{ "id": "b", "text": "Das Dateisystem wird nur lesend eingehängt.", "correct": false, "explanation": "Das ist `ro`." },
|
||||
{ "id": "c", "text": "SUID-Bits werden ignoriert.", "correct": false, "explanation": "Das ist `nosuid`." },
|
||||
{ "id": "d", "text": "Gerätedateien werden nicht ausgewertet.", "correct": false, "explanation": "Das ist `nodev`." },
|
||||
{ "id": "e", "text": "Das Dateisystem wird beim Start nicht eingehängt.", "correct": false, "explanation": "Das ist `noauto`." }
|
||||
],
|
||||
"explanation": "`defaults` steht für `rw,suid,dev,exec,auto,nouser,async`.",
|
||||
"references": ["man 8 mount"]
|
||||
},
|
||||
{
|
||||
"id": "104.3-006",
|
||||
"objective": "104.3",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Option im vierten Feld von `/etc/fstab` verhindert, dass ein Dateisystem beim Start bzw. mit `mount -a` automatisch eingehängt wird?",
|
||||
"answers": ["noauto"],
|
||||
"explanation": "Typisch für Wechselmedien; manuell mit `mount /mnt/usb` einhängen, da der Eintrag bekannt ist.",
|
||||
"references": ["man 5 fstab"]
|
||||
},
|
||||
{
|
||||
"id": "104.3-007",
|
||||
"objective": "104.3",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Wie hängt man das Root-Dateisystem im laufenden Betrieb **nur lesend** neu ein?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`mount -o remount,ro /`", "correct": true, "explanation": "`remount` ändert Optionen, ohne auszuhängen." },
|
||||
{ "id": "b", "text": "`umount / && mount -r /`", "correct": false, "explanation": "Das Root-Dateisystem lässt sich im Betrieb nicht aushängen." },
|
||||
{ "id": "c", "text": "`mount -a -o ro`", "correct": false, "explanation": "Hängt die noch nicht eingehängten fstab-Einträge ein." },
|
||||
{ "id": "d", "text": "`chmod -R a-w /`", "correct": false, "explanation": "Ändert Rechte aller Dateien – schwerwiegend und nicht gemeint." },
|
||||
{ "id": "e", "text": "`fsck -r /`", "correct": false, "explanation": "`fsck` hängt nichts ein." }
|
||||
],
|
||||
"explanation": "Umgekehrt im Rettungsmodus: `mount -o remount,rw /`, um Konfigurationen zu reparieren.",
|
||||
"references": ["man 8 mount"]
|
||||
},
|
||||
{
|
||||
"id": "104.3-008",
|
||||
"objective": "104.3",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Wie muss eine systemd-Mount-Unit heißen, die `/srv/backup` einhängt?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`srv-backup.mount`", "correct": true, "explanation": "Der Name leitet sich vom Pfad ab: führenden `/` weglassen, weitere `/` durch `-` ersetzen." },
|
||||
{ "id": "b", "text": "`backup.mount`", "correct": false, "explanation": "Der Name muss dem vollständigen Pfad entsprechen." },
|
||||
{ "id": "c", "text": "`srv/backup.mount`", "correct": false, "explanation": "Schrägstriche sind im Unit-Namen nicht erlaubt." },
|
||||
{ "id": "d", "text": "`srv-backup.service`", "correct": false, "explanation": "Mount-Units haben die Endung `.mount`." },
|
||||
{ "id": "e", "text": "`mount-srv-backup.target`", "correct": false, "explanation": "Targets gruppieren Units; einhängen tun sie nicht." }
|
||||
],
|
||||
"explanation": "Hilfe: `systemd-escape -p --suffix=mount /srv/backup`. Für Einträge in `/etc/fstab` erzeugt systemd solche Units automatisch.",
|
||||
"references": ["man 5 systemd.mount"]
|
||||
},
|
||||
{
|
||||
"id": "104.3-009",
|
||||
"objective": "104.3",
|
||||
"type": "multi",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Aussagen zum Einhängen von Dateisystemen treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Die fstab-Option `user` erlaubt normalen Benutzern, das Dateisystem einzuhängen.", "correct": true, "explanation": "Nur derselbe Benutzer darf es wieder aushängen (`users`: alle)." },
|
||||
{ "id": "b", "text": "`findmnt` zeigt die eingehängten Dateisysteme als Baum.", "correct": true, "explanation": "Mit Quelle, Ziel, Typ und Optionen." },
|
||||
{ "id": "c", "text": "`umount` akzeptiert nur den Gerätenamen, nicht den Einhängepunkt.", "correct": false, "explanation": "Beides funktioniert: `umount /dev/sdb1` oder `umount /mnt/daten`." },
|
||||
{ "id": "d", "text": "`defaults` enthält die Option `noexec`.", "correct": false, "explanation": "`defaults` enthält `exec`." },
|
||||
{ "id": "e", "text": "`mount` ohne Argumente hängt alle Dateisysteme aus.", "correct": false, "explanation": "Es listet die eingehängten Dateisysteme." }
|
||||
],
|
||||
"explanation": "Aktuell eingehängte Dateisysteme stehen auch in `/proc/mounts` (bzw. `/proc/self/mounts`).",
|
||||
"references": ["man 8 findmnt", "man 5 fstab"]
|
||||
},
|
||||
{
|
||||
"id": "104.5-006",
|
||||
"objective": "104.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was bedeutet das `t` am Ende von `drwxrwxrwt` beim Verzeichnis `/tmp`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Sticky-Bit: Dateien darf nur ihr Eigentümer (bzw. der Verzeichniseigentümer oder root) löschen oder umbenennen.", "correct": true, "explanation": "Obwohl alle Schreibrecht haben, können sie fremde Dateien nicht löschen." },
|
||||
{ "id": "b", "text": "Das Verzeichnis ist temporär und wird beim Neustart gelöscht.", "correct": false, "explanation": "Ob `/tmp` geleert wird, regelt die Distribution, nicht das `t`." },
|
||||
{ "id": "c", "text": "Dateien im Verzeichnis erben die Gruppe des Verzeichnisses.", "correct": false, "explanation": "Das ist SGID auf Verzeichnissen." },
|
||||
{ "id": "d", "text": "Programme im Verzeichnis laufen mit den Rechten des Eigentümers.", "correct": false, "explanation": "Das ist SUID bei Dateien." },
|
||||
{ "id": "e", "text": "Das Verzeichnis ist ein symbolischer Link.", "correct": false, "explanation": "Links erkennt man am `l` am **Anfang**." }
|
||||
],
|
||||
"explanation": "Setzen: `chmod +t verzeichnis` bzw. oktal `1777`. Großes `T` heißt: Sticky gesetzt, aber kein x für andere.",
|
||||
"references": ["man 1 chmod"]
|
||||
},
|
||||
{
|
||||
"id": "104.5-007",
|
||||
"objective": "104.5",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Geben Sie den `chmod`-Befehl in **symbolischer** Schreibweise ein, der „anderen“ (others) alle Rechte an `bericht.txt` entzieht.",
|
||||
"answers": ["chmod o-rwx bericht.txt", "chmod o= bericht.txt", "chmod o-rxw bericht.txt", "chmod o-wrx bericht.txt", "chmod o-wxr bericht.txt", "chmod o-xrw bericht.txt", "chmod o-xwr bericht.txt"],
|
||||
"explanation": "`u` Eigentümer, `g` Gruppe, `o` andere, `a` alle; `+` hinzufügen, `-` entfernen, `=` genau setzen.",
|
||||
"references": ["man 1 chmod"]
|
||||
},
|
||||
{
|
||||
"id": "104.5-008",
|
||||
"objective": "104.5",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Wirkung hat das **SGID-Bit** auf einem Verzeichnis?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Neu angelegte Dateien und Unterverzeichnisse erhalten die Gruppe des Verzeichnisses.", "correct": true, "explanation": "Praktisch für gemeinsame Projektverzeichnisse." },
|
||||
{ "id": "b", "text": "Nur der Eigentümer darf Dateien löschen.", "correct": false, "explanation": "Das ist das Sticky-Bit." },
|
||||
{ "id": "c", "text": "Programme laufen mit den Rechten der Gruppe des Aufrufers.", "correct": false, "explanation": "Programme laufen normal ohnehin mit der Gruppe des Aufrufers; SGID auf Dateien setzt die Gruppe der **Datei**." },
|
||||
{ "id": "d", "text": "Das Verzeichnis kann nicht gelöscht werden.", "correct": false, "explanation": "Dafür gibt es kein Rechtebit (nur das Attribut `chattr +i`)." },
|
||||
{ "id": "e", "text": "Alle Benutzer werden Mitglied der Gruppe.", "correct": false, "explanation": "Rechtebits ändern keine Gruppenmitgliedschaften." }
|
||||
],
|
||||
"explanation": "Setzen: `chmod g+s verzeichnis`; in `ls -l` steht dann `s` an der x-Stelle der Gruppe.",
|
||||
"references": ["man 1 chmod"]
|
||||
},
|
||||
{
|
||||
"id": "104.5-009",
|
||||
"objective": "104.5",
|
||||
"type": "single",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Rechte hat ein Verzeichnis nach `chmod 2770 projekt`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`drwxrws---`", "correct": true, "explanation": "2 = SGID, 7 = rwx (Eigentümer), 7 = rwx (Gruppe, mit `s` für SGID), 0 = keine (andere)." },
|
||||
{ "id": "b", "text": "`drwsrwx---`", "correct": false, "explanation": "`s` beim Eigentümer wäre SUID (4xxx)." },
|
||||
{ "id": "c", "text": "`drwxrwx--T`", "correct": false, "explanation": "`T` wäre das Sticky-Bit (1xxx)." },
|
||||
{ "id": "d", "text": "`d-w-rwxrwx`", "correct": false, "explanation": "Die führende 2 ist kein Rechtewert für den Eigentümer." },
|
||||
{ "id": "e", "text": "`drwxr-x---`", "correct": false, "explanation": "Das wäre 750 ohne Sonderbit." }
|
||||
],
|
||||
"explanation": "Sonderbits als vierte Ziffer vorne: 4 SUID, 2 SGID, 1 Sticky, auch kombiniert (z. B. 3770).",
|
||||
"references": ["man 1 chmod"]
|
||||
},
|
||||
{
|
||||
"id": "104.5-010",
|
||||
"objective": "104.5",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wie setzt man für `/srv/projekt` und **alles darin** den Eigentümer `anna` und die Gruppe `team`?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`chown -R anna:team /srv/projekt`", "correct": true, "explanation": "`-R` arbeitet rekursiv, `benutzer:gruppe` setzt beides." },
|
||||
{ "id": "b", "text": "`chown anna:team /srv/projekt`", "correct": false, "explanation": "Ändert nur das Verzeichnis selbst, nicht den Inhalt." },
|
||||
{ "id": "c", "text": "`chmod -R anna:team /srv/projekt`", "correct": false, "explanation": "`chmod` ändert Rechte, keine Eigentümer." },
|
||||
{ "id": "d", "text": "`chgrp -R anna:team /srv/projekt`", "correct": false, "explanation": "`chgrp` setzt nur die Gruppe und erwartet nur einen Gruppennamen." },
|
||||
{ "id": "e", "text": "`usermod -R team anna /srv/projekt`", "correct": false, "explanation": "`usermod` ändert Benutzerkonten." }
|
||||
],
|
||||
"explanation": "Den Eigentümer ändern darf nur root.",
|
||||
"references": ["man 1 chown"]
|
||||
},
|
||||
{
|
||||
"id": "104.5-011",
|
||||
"objective": "104.5",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen zu Rechten an **Verzeichnissen** treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Das x-Recht erlaubt, das Verzeichnis zu betreten und auf Einträge darin zuzugreifen.", "correct": true, "explanation": "Ohne x kein `cd` und kein Zugriff auf Dateien darin, auch wenn ihr Name bekannt ist." },
|
||||
{ "id": "b", "text": "Das w-Recht (zusammen mit x) erlaubt, Dateien darin anzulegen, umzubenennen und zu löschen.", "correct": true, "explanation": "Löschen ist eine Änderung des Verzeichnisses." },
|
||||
{ "id": "c", "text": "Das r-Recht allein erlaubt, den Inhalt der Dateien zu lesen.", "correct": false, "explanation": "r am Verzeichnis erlaubt nur, die Namen aufzulisten; Dateiinhalt hängt von den Dateirechten (und x am Verzeichnis) ab." },
|
||||
{ "id": "d", "text": "Zum Löschen einer Datei braucht man Schreibrecht an der Datei selbst.", "correct": false, "explanation": "Entscheidend ist das Schreibrecht am Verzeichnis (Ausnahme: Sticky-Bit)." },
|
||||
{ "id": "e", "text": "Die umask ändert auch die Rechte bereits bestehender Dateien.", "correct": false, "explanation": "Die umask wirkt nur beim Anlegen neuer Dateien." }
|
||||
],
|
||||
"explanation": "Üblich: Verzeichnisse 755 bzw. 750, Dateien 644 bzw. 640.",
|
||||
"references": ["man 7 inode", "man 1 chmod"]
|
||||
},
|
||||
{
|
||||
"id": "104.6-004",
|
||||
"objective": "104.6",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Was passiert mit einem symbolischen Link, wenn seine Zieldatei gelöscht wird?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Der Link bleibt bestehen, zeigt aber ins Leere (verwaister Link).", "correct": true, "explanation": "Ein Symlink speichert nur den Pfad; Zugriffe melden „No such file or directory“." },
|
||||
{ "id": "b", "text": "Der Link wird automatisch mitgelöscht.", "correct": false, "explanation": "Linux entfernt Symlinks nicht automatisch." },
|
||||
{ "id": "c", "text": "Der Link enthält weiterhin den Dateiinhalt.", "correct": false, "explanation": "So verhält sich ein Hardlink, kein Symlink." },
|
||||
{ "id": "d", "text": "Der Link wird zu einem Hardlink.", "correct": false, "explanation": "Der Link-Typ ändert sich nie." },
|
||||
{ "id": "e", "text": "Das Löschen schlägt fehl, solange ein Link existiert.", "correct": false, "explanation": "Symlinks verhindern das Löschen nicht." }
|
||||
],
|
||||
"explanation": "Verwaiste Links finden: `find /pfad -xtype l`.",
|
||||
"references": ["man 7 symlink"]
|
||||
},
|
||||
{
|
||||
"id": "104.6-005",
|
||||
"objective": "104.6",
|
||||
"type": "fill",
|
||||
"difficulty": 1,
|
||||
"question": "Welcher Befehl (nur der Name) gibt das Ziel eines symbolischen Links aus?",
|
||||
"answers": ["readlink"],
|
||||
"explanation": "`readlink -f` löst die ganze Kette auf und gibt den absoluten Pfad aus. Auch `ls -l` zeigt `link -> ziel`.",
|
||||
"references": ["man 1 readlink"]
|
||||
},
|
||||
{
|
||||
"id": "104.6-006",
|
||||
"objective": "104.6",
|
||||
"type": "multi",
|
||||
"difficulty": 2,
|
||||
"question": "Welche Aussagen über **symbolische** Links treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "Symbolische Links können auf Dateien in anderen Dateisystemen zeigen.", "correct": true, "explanation": "Sie speichern nur einen Pfad." },
|
||||
{ "id": "b", "text": "`ls -l` zeigt bei einem Symlink ein `l` als erstes Zeichen.", "correct": true, "explanation": "z. B. `lrwxrwxrwx … aktuell -> release-2.4`." },
|
||||
{ "id": "c", "text": "Ein Symlink teilt sich den Inode mit seinem Ziel.", "correct": false, "explanation": "Das gilt für Hardlinks; ein Symlink hat einen eigenen Inode." },
|
||||
{ "id": "d", "text": "Löscht man den Symlink, wird auch das Ziel gelöscht.", "correct": false, "explanation": "`rm link` entfernt nur den Link." },
|
||||
{ "id": "e", "text": "Symlinks können nicht auf Verzeichnisse zeigen.", "correct": false, "explanation": "Symlinks auf Verzeichnisse sind üblich (z. B. `/bin -> usr/bin`)." }
|
||||
],
|
||||
"explanation": "Relative Symlinks (`ln -s ../ziel link`) gelten relativ zum Ort des Links, nicht zum aktuellen Verzeichnis.",
|
||||
"references": ["man 7 symlink"]
|
||||
},
|
||||
{
|
||||
"id": "104.7-004",
|
||||
"objective": "104.7",
|
||||
"type": "single",
|
||||
"difficulty": 1,
|
||||
"question": "Wohin gehört laut FHS ein eigenständiges **Zusatz-Softwarepaket** eines Drittanbieters?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`/opt`", "correct": true, "explanation": "Je Paket ein Unterverzeichnis, z. B. `/opt/<anbieter>/`." },
|
||||
{ "id": "b", "text": "`/srv`", "correct": false, "explanation": "Für Daten, die der Rechner als Dienst ausliefert." },
|
||||
{ "id": "c", "text": "`/var/lib`", "correct": false, "explanation": "Für Zustandsdaten von Programmen." },
|
||||
{ "id": "d", "text": "`/etc`", "correct": false, "explanation": "Nur für Konfiguration." },
|
||||
{ "id": "e", "text": "`/boot`", "correct": false, "explanation": "Nur für Bootloader, Kernel und initramfs." }
|
||||
],
|
||||
"explanation": "Selbst kompilierte Software installiert man üblicherweise unter `/usr/local` (bin, lib, share).",
|
||||
"references": ["man 7 hier"]
|
||||
},
|
||||
{
|
||||
"id": "104.7-005",
|
||||
"objective": "104.7",
|
||||
"type": "fill",
|
||||
"difficulty": 2,
|
||||
"question": "In welchem Verzeichnis liegen laut FHS temporäre Dateien, die einen **Neustart überdauern** sollen? (Pfad)",
|
||||
"answers": ["/var/tmp"],
|
||||
"explanation": "`/tmp` darf beim Start geleert werden (oft tmpfs im RAM), `/var/tmp` bleibt erhalten.",
|
||||
"references": ["man 7 hier"]
|
||||
},
|
||||
{
|
||||
"id": "104.7-006",
|
||||
"objective": "104.7",
|
||||
"type": "multi",
|
||||
"difficulty": 1,
|
||||
"question": "Welche Aussagen zum Filesystem Hierarchy Standard treffen zu?",
|
||||
"options": [
|
||||
{ "id": "a", "text": "`/usr` enthält weitgehend statische Daten und kann schreibgeschützt eingehängt werden.", "correct": true, "explanation": "Programme, Bibliotheken, Dokumentation – nicht hostspezifisch." },
|
||||
{ "id": "b", "text": "`/home` enthält die Home-Verzeichnisse der Benutzer.", "correct": true, "explanation": "Das Home von root liegt dagegen in `/root`." },
|
||||
{ "id": "c", "text": "`/proc` enthält die Konfigurationsdateien der Dienste.", "correct": false, "explanation": "`/proc` ist ein virtuelles Dateisystem mit Prozess- und Kernelinformationen." },
|
||||
{ "id": "d", "text": "`/sbin` ist für Programme normaler Benutzer gedacht.", "correct": false, "explanation": "`/sbin` enthält Systemprogramme für die Administration." },
|
||||
{ "id": "e", "text": "`/dev` enthält den Quellcode der Gerätetreiber.", "correct": false, "explanation": "`/dev` enthält Gerätedateien." }
|
||||
],
|
||||
"explanation": "Kurzüberblick: `man 7 hier` bzw. `man 7 file-hierarchy` (systemd).",
|
||||
"references": ["man 7 hier"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user