[
  {
    "title": "Which parameter do you add to `ls` to view also hidden files?",
    "category": "lpic-101",
    "tags": ["command"],
    "kind": "single",
    "resolution": [
      3
    ],
    "answers": [
      {
        "content": "-h",
        "explanation": "ls -lh shows the size values in **h**uman readable format."
      },
      {
        "content": "-l",
        "explanation": "ls -l is the list view."
      },
      {
        "content": "-r",
        "explanation": "ls -r reversely orders the output (DESC)."
      },
      {
        "content": "-a",
        "explanation": "ls -a shows hidden files starting with a dot."
      }
    ]
  },
  {
    "kind": "single",
    "answers": [
      {
        "content": "-b",
        "explanation": "-b is the bus centric view"
      },
      {
        "content": "-v",
        "explanation": "Verbose displays more detailed information about the devices."
      },
      {
        "content": "-t",
        "explanation": "Tree-like diagram view."
      },
      {
        "content": "-k",
        "explanation": "Show kernel drivers handling the device and modules capable of handling it."
      },
      {
        "content": "-s",
        "explanation": "Selection of devices."
      }
    ],
    "title": "Which parameter allows you to filter for devices (PCI-Bus) with lspci?",
    "category": "lpic-101",
    "tags": ["hardware"],
    "difficulty": "4",
    "resolution": [
      4
    ]
  },
  {
    "title": "How do you obtain the ip address of an network adapter in Linux?",
    "category": "lpic-101",
    "tags": ["network"],
    "kind": "single",
    "resolution": [
      0
    ],
    "answers": [
      {
        "content": "ip address",
        "explanation": "`ip address` or `ip a` is the correct answer."
      },
      {
        "content": "ipconfig",
        "explanation": "`ipconfig` is a windows command."
      },
      {
        "content": "route",
        "explanation": "With `route` you can change or look at the IP routing table."
      },
      {
        "content": "arp",
        "explanation": "`arp` displays / manipulates the IPv4 neighbour cache. (Address resolution protocol)"
      },
      {
        "content": "lsof -i",
        "explanation": "`lsof -i` lists files / processes with open ports."
      }
    ]
  },
  {
    "title": "Which tools can be used to change the nice value of a running process?",
    "category": "lpic-101",
    "tags": ["command"],
    "kind": "multiple",
    "resolution": [
      2,
      3
    ],
    "answers": [
      {
        "content": "nice",
        "explanation": "With nice you can set the nice value before running the application. `nice [OPTION] [COMMAND]`"
      },
      {
        "content": "ps",
        "explanation": "ps lists the running processes."
      },
      {
        "content": "renice",
        "explanation": "Correct! `renice -10 -p 123` would change the nice value of a running process with the PID 123 to -10."
      },
      {
        "content": "top",
        "explanation": "Correct! `top` allows you to change the nice value too."
      },
      {
        "content": "netstat",
        "explanation": "`netstat` shows you open ports, sockets and connections etc."
      }
    ]
  },
  {
    "title": "Which file contains information on the CPU(s) and it's bugs? (Full path and filename)",
    "category": "lpic-101",
    "tags": ["proc", "files"],
    "difficulty": "8",
    "kind": "text",
    "resolution": [
      "/proc/cpuinfo"
    ],
    "explanation": "`/proc/cpuinfo` contains information about the CPU(s) and lists known bugs, like Meltdown and Spectre.",
    "answers": []
  },
  {
    "title": "Which command generates the following output? (No parameters)",
    "explanation": "lsusb lists the USB devices connected to the computer.",
    "kind": "text",
    "difficulty": "3",
    "answers": [
    ],
    "code_block": "Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub\nBus 007 Device 005: ID 1532:005c Razer USA, Ltd Razer DeathAdder Elite Mouse\nBus 007 Device 004: ID 0fd9:0060 Elgato Systems GmbH Stream Deck\nBus 007 Device 003: ID 1038:1724 SteelSeries ApS SteelSeries Rival 600\nBus 007 Device 002: ID 04b3:3025 IBM Corp. NetVista Full Width Keyboard",
    "category": "lpic-101",
    "tags": ["hardware"],
    "resolution": [
      "lsusb"
    ]
  },
  {
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "modprobe -r",
        "explanation": "With modprobe -r you unload a module."
      },
      {
        "content": "insmod",
        "explanation": "insmod loads a module without it\"s dependencies. You probably want to use modprobe."
      },
      {
        "content": "rmod",
        "explanation": "There is no rmod command. rmmod exists, but you probably want to use modprobe -r instead."
      },
      {
        "content": "ldd",
        "explanation": "ldd shows the dynamic library dependencies of a command."
      }
    ],
    "title": "How do you unload a Linux module from the running Kernel?",
    "category": "lpic-101",
    "tags": ["kernel", "hardware"],
    "resolution": [
      0
    ]
  },
  {
    "title": "In which directory is the compiled Linux kernel normally located?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "1",
    "answers": [
      {
        "content": "/sys",
        "explanation": "The /sys directory provides information to the kernel like /proc, but better structured."
      },
      {
        "content": "/proc",
        "explanation": "The /proc mount point contains information about running processes and the Kernel."
      },
      {
        "content": "/lib/modules",
        "explanation": "/lib/modules/$(uname -r) contains the kernel drivers."
      },
      {
        "content": "/dev",
        "explanation": "Special or device files for physical devices."
      },
      {
        "content": "/boot",
        "explanation": "The boot folder contains typically the system kernel (or /)  and the boot loader."
      }
    ],
    "category": "lpic-101",
    "tags": ["kernel"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which partition type should an UEFI boot partition have?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "7",
    "answers": [
      {
        "content": "8300",
        "explanation": "This is the default Linux partition type."
      },
      {
        "content": "8200",
        "explanation": "This is the Linux Swap type"
      },
      {
        "content": "0700",
        "explanation": "Windows NTFS/exFAT type."
      },
      {
        "content": "4200",
        "explanation": "SFS / Windows 2000 dynamic extender partition maker."
      },
      {
        "content": "EF00",
        "explanation": "EF00 is the Efi System Partition which is required for booting with UEFI and GPT."
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which filesystem should the UEFI partition use?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "6",
    "answers": [
      {
        "content": "NTFS",
        "explanation": "NTFS is the default Windows file system."
      },
      {
        "content": "ext4",
        "explanation": "ext4 is a Linux file system."
      },
      {
        "content": "btrfs",
        "explanation": "btrfs is a Linux file system."
      },
      {
        "content": "FAT32",
        "explanation": "The UEFI specification mandates support for FAT16 and FAT32 file systems."
      },
      {
        "content": "xfs",
        "explanation": "XFS is a Linux / Unix filesystem."
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      3
    ]
  },
  {
    "title": "Which of the following are Linux bootloaders?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "5",
    "answers": [
      {
        "content": "systemd-boot",
        "explanation": "systemd-boot is a simple UEFI boot manager"
      },
      {
        "content": "mboot",
        "explanation": "mboot is a custom MicroPython bootloader for STM32 MCUs"
      },
      {
        "content": "GRUB",
        "explanation": "GRUB is a Linux boot loader."
      },
      {
        "content": "efibootmgr",
        "explanation": "efibootmgr is a tool to manipulate the UEFI Boot Manager (Bios)."
      },
      {
        "content": "blkid",
        "explanation": "Prints block devices attributes"
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      0,
      2
    ]
  },
  {
    "title": "Which of the following is true? The initramfs normally contains ..",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "files needed files for the system boot",
        "explanation": "The initramfs contains the needed files, e.g. drivers, firmware, scripts to boot the system."
      },
      {
        "content": "the Linux Kernel",
        "explanation": "The Kernel can contain the initramfs, but not the other way around."
      },
      {
        "content": "the Boot loader",
        "explanation": "The initramfs can make boot process more flexible (hooks etc.), but contains no bootloader."
      },
      {
        "content": "the initial ramdisk for use with /sys, /proc and /dev",
        "explanation": "/sys, /proc and /dev are mounted during the boot (sysfs etc.)"
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      0
    ]
  },
  {
    "title": "Which of the following are Linux init systems?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "3",
    "answers": [
      {
        "content": "systemd \"System and Service Manager\"",
        "explanation": "The systemd \"System and Service Manager\" is an init system. systemd itself is a software suite providing more software."
      },
      {
        "content": "Upstart",
        "explanation": "Upstart is a now deprecated init system initiated by Ubuntu"
      },
      {
        "content": "service",
        "explanation": "service is a command to control services in a System V Init environment"
      },
      {
        "content": "systemctl",
        "explanation": "systemctl is the systemd command to control services and more."
      },
      {
        "content": "System V Init",
        "explanation": "System V (SysV) was the most common Linux / Unix init system for a long time. Although there where several SysV Init replacement over the years most kept compatible with SysV."
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      0,
      1,
      4
    ]
  },
  {
    "title": "Where is the partition table located on a mass storage device with an MBR partition scheme?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": 0,
    "answers": [
      {
        "content": "At the beginning of a partition",
        "explanation": "No, partitions can contain a Partition Boot Record (PBR / VBR)"
      },
      {
        "content": "On multiple locations of the device",
        "explanation": "GPT stores cyclic redundancy checks (CRC) on multiple locations, MBR does not."
      },
      {
        "content": "At the end of the storage device",
        "explanation": "No"
      },
      {
        "content": "In an extended partition",
        "explanation": "MBR differentiates between primary, extended and logical partitions, but this has nothing to do with the location of the partition table."
      },
      {
        "content": "At the beginning / First sector of the device",
        "explanation": "The MBR consists of 512 or more bytes and is located in the first sector of the device"
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      4
    ]
  },
  {
    "title": "How many primary partitions can you have with an MBR partitioning scheme?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "1",
    "answers": [
      {
        "content": "1",
        "explanation": ""
      },
      {
        "content": "2",
        "explanation": ""
      },
      {
        "content": "4",
        "explanation": "You can have up to four primary / extended partitions."
      },
      {
        "content": "15",
        "explanation": ""
      },
      {
        "content": "128",
        "explanation": ""
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      2
    ]
  },
  {
    "title": "What is the maximum addressable storage space of a MBR partitioned hard disk with a 512 byte sector size?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "1024 GB",
        "explanation": "GB  is 10^9 bytes, e.g. 1,000,000,000 bytes"
      },
      {
        "content": "512 GB",
        "explanation": ""
      },
      {
        "content": "2048 Gb",
        "explanation": "Gb = Gigabit"
      },
      {
        "content": "2048 GiB",
        "explanation": "Correct, 2^32 x 512 bytes (~2TiB) is the maximum addressable storage size of MBR."
      },
      {
        "content": "1024 GiB",
        "explanation": ""
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      3
    ]
  },
  {
    "title": "How many partitions does GPT support?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "4",
        "explanation": "MBR supports up to 4 primary / extended partitions."
      },
      {
        "content": "32",
        "explanation": "No"
      },
      {
        "content": "64",
        "explanation": "No"
      },
      {
        "content": "128",
        "explanation": "Correct, GUID Partition Table (GPT) supports up to 128 partitions."
      },
      {
        "content": "256",
        "explanation": "No"
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      3
    ]
  },
  {
    "title": "Which commands prints the Linux kernel message buffer?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "2",
    "answers": [
      {
        "content": "uname",
        "explanation": "`uname -r` prints the Kernel release version."
      },
      {
        "content": "klog",
        "explanation": "There is no such command, `klogd` is a daemon which logs Linux Kernel messages with syslogd."
      },
      {
        "content": "kernellog",
        "explanation": "Not existing"
      },
      {
        "content": "None, the kernel log can be found in a log file",
        "explanation": "As the kernel log starts, even before any filesystem is available, it's saved in a buffer and accessed by a command. On most distributions there are log files, where the Kernel messages are stored once the filesystem is ready."
      },
      {
        "content": "dmesg",
        "explanation": "dmesg (display / driver message) in the command that prints the message buffer of the Kernel."
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which of the following is true for systemd-journald?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "5",
    "answers": [
      {
        "content": "Stored in /var/log/messages",
        "explanation": "On certain distributions there is a copy of the log in this file with systemd, but originally it's not stored there."
      },
      {
        "content": "Stored in /var/log/syslog",
        "explanation": "On certain distributions there is a copy of the log in this file with systemd, but originally it's not stored there."
      },
      {
        "content": "Stored in /var/log/journal",
        "explanation": "The journal is stored in binary format in /var/log/journal"
      },
      {
        "content": "The log is stored in text files",
        "explanation": "With systemd-journal the systems log is no longer stored in text files, but in binary format."
      },
      {
        "content": "The logs are stored in binary format.",
        "explanation": "Correct, systemd-journal stores logs in a binray format (Journal File Format)"
      }
    ],
    "category": "lpic-101",
    "tags": ["init"],
    "resolution": [
      2,
      4
    ]
  },
  {
    "title": "What kind of Kernel is the Linux one?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "5",
    "answers": [
      {
        "content": "Microkernel",
        "explanation": "A microkernel is the near-minimum amount of software to implement an operating system and are often smaller than monolithic kernels."
      },
      {
        "content": "Hybrid Kernel",
        "explanation": "A hybrid kernel tries to combine aspects of a micro- and a monolithic Kernel. The Windows NT Kernel is a prominent example."
      },
      {
        "content": "Nanokernel",
        "explanation": "Nanokernel normally referenced to very small kernels (in terms of code), often it references also to a virtualization layer under a operating system (hypervisor)."
      },
      {
        "content": "Exokernel",
        "explanation": "With an Exokernel, software can communicate with hardware much more directly."
      },
      {
        "content": "Monolithic Kernel",
        "explanation": "Correct, the Linux Kernel is a monolithic one, handling most things, like process management, in the kernel space."
      }
    ],
    "category": "lpic-101",
    "tags": ["kernel"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which of the following commands restarts a Linux system on a SysV system immediately?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "3",
    "answers": [
      {
        "content": "shutdown -h now",
        "explanation": "This would shut down the system."
      },
      {
        "content": "init 6",
        "explanation": "Correct, switching to the sixth runlevel with SysVInit reboots a system."
      },
      {
        "content": "reboot",
        "explanation": "Correct, the reboot command immediately reboots the system."
      },
      {
        "content": "restart",
        "explanation": "This command is not existing"
      },
      {
        "content": "init 0",
        "explanation": "This would shutdown the system"
      },
      {
        "content": "shutdown -r 1",
        "explanation": "This would reboot the system in one minute, not immediately!"
      }
    ],
    "category": "lpic-101",
    "tags": ["init"],
    "resolution": [
      1,
      2
    ]
  },
  {
    "title": "How do you start the apache2 service with systemd without a reboot?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "systemctl enable apache2",
        "explanation": "This would enable the service, but not start it directly (only after reboot)."
      },
      {
        "content": "service apache2 start",
        "explanation": "This is the old SysVInit way of starting a service."
      },
      {
        "content": "start apache2",
        "explanation": "This were old SysVInit scripts (refering to serviec) for starting a service."
      },
      {
        "content": "systemctl start apache2",
        "explanation": "Correct, systemctl start apache2 starts the service, systemctl stop apache2 would stop it (you can also add .service to the name)."
      },
      {
        "content": "init 5",
        "explanation": "With SysVInit this would change to the fifth run level of the system."
      }
    ],
    "category": "lpic-101",
    "tags": ["init"],
    "resolution": [
      3
    ]
  },
  {
    "title": "In which file the default runlevel for a SysVInit system is set?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "/etc/init",
        "explanation": "There is no such file"
      },
      {
        "content": "/etc/init.d",
        "explanation": "/etc/init.d is a folder containing the shell scripts to control services."
      },
      {
        "content": "/etc/fstab",
        "explanation": "The fstab contains the static information about the filesystems."
      },
      {
        "content": "/etc/inittab",
        "explanation": "Correc,t the inittab contains the run level configuration. For example: id:3:initdefault: would tell init to boot into run level 3 by default."
      },
      {
        "content": "/boot/grub/grub.cfg",
        "explanation": "This is the configuration file of the bootloader, not the init system."
      }
    ],
    "category": "lpic-101",
    "tags": ["init"],
    "resolution": [
      3
    ]
  },
  {
    "title": "How do you power down a system in 5 minutes?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "2",
    "answers": [
      {
        "content": "init 0",
        "explanation": "This would immediately shut down the system."
      },
      {
        "content": "init 6",
        "explanation": "This would immediately reboot the system."
      },
      {
        "content": "powerdown -h 300",
        "explanation": "This command is not existing."
      },
      {
        "content": "shutdown -h 5",
        "explanation": "Correct, this would shut down the system in 5 minutes."
      },
      {
        "content": "shutdown -h 300",
        "explanation": "This would power off the system in 300 minutes."
      }
    ],
    "category": "lpic-101",
    "tags": ["init"],
    "resolution": [
      3
    ]
  },
  {
    "title": "How do you send a broadcast message to all logged in users? (Without files)",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "3",
    "answers": [
      {
        "content": "echo \"Hello\"",
        "explanation": "This just outputs Hello to the standard output."
      },
      {
        "content": "wall \"Hello\"",
        "explanation": "This would try to open and send a file called \"Hello\"."
      },
      {
        "content": "echo \"Hello\" | wall",
        "explanation": "You can pipe the message to wall to send a message to all logged in users."
      },
      {
        "content": "wall",
        "explanation": "When you just type wall, you can enter your message and stop it with Ctrl + D"
      },
      {
        "content": "netmsg \"Hallo\"",
        "explanation": "This would be a windows command."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      2,
      3
    ]
  },
  {
    "title": "Which folder generally would contain the apache2 / httpd executable on Linux?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "/lib",
        "explanation": "The lib folder normally contains the shared libraries to boot the system, the kernel modules and the most important libraries."
      },
      {
        "content": "/usr/lib",
        "explanation": "The lib folder contains libraries."
      },
      {
        "content": "/sbin",
        "explanation": "Like /bin this holds commands needed to boot the system, but are normally not executed by normal users (like fdisk)."
      },
      {
        "content": "/bin",
        "explanation": "The /bin directory normally contains executable programs needed in single user mode and to boot the system up."
      },
      {
        "content": "/usr/bin",
        "explanation": "As the apache2 executable is not mandatory for a system boot, it is normally contained in /usr/bin."
      }
    ],
    "category": "lpic-101",
    "tags": ["filesystem"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which file configures the GRUB (v2) boot loader?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "5",
    "answers": [
      {
        "content": "/boot/grub.cfg",
        "explanation": "No"
      },
      {
        "content": "/boot/loader/loader.conf",
        "explanation": "This is the configuration file for systemd-boot (Gummiboot before)."
      },
      {
        "content": "/boot/grub/menu.lst",
        "explanation": "This was the config file for Grub Version 1"
      },
      {
        "content": "/boot/grub/grub.conf",
        "explanation": "No, the ending is different for this file."
      },
      {
        "content": "/boot/grub/grub.cfg",
        "explanation": "Correct, the GRand Unified Bootloader configuration can be found there since version 2 (1.98)"
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      4
    ]
  },
  {
    "title": "How do you enable an existing swap partition?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "mkswap",
        "explanation": "This would create a swap partition."
      },
      {
        "content": "onswap",
        "explanation": "No."
      },
      {
        "content": "swapon",
        "explanation": "Correct, swapon activates an swap partition. (Reminder: Partition type 82)"
      },
      {
        "content": "free",
        "explanation": "free shows the free memory and swap space."
      },
      {
        "content": "swdisk",
        "explanation": "This command does not exist."
      }
    ],
    "category": "lpic-101",
    "tags": ["filesystem"],
    "resolution": [
      2
    ]
  },
  {
    "title": "Which partition type code should be used for a swap partition?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "6",
    "answers": [
      {
        "content": "83",
        "explanation": "No, this is the partition scheme for Linux"
      },
      {
        "content": "42",
        "explanation": "No, this type is used by Windows 2000 special partitions."
      },
      {
        "content": "82",
        "explanation": "Correct, a swap partition should use the partition code 82."
      },
      {
        "content": "ef",
        "explanation": "ef00 is an EFI System Partition"
      },
      {
        "content": "07",
        "explanation": "This is partition type is used for Windows NTFS and exFAT systems."
      }
    ],
    "category": "lpic-101",
    "tags": ["filesystem"],
    "resolution": [
      2
    ]
  },
  {
    "title": "Which directory normally contains the initramfs / initrd file? (not /)",
    "explanation": "The initramfs / initrd normally is located in the boot directory. (/ is also allowed, but not common)",
    "code_block": "",
    "kind": "text",
    "difficulty": 0,
    "answers": [
    ],
    "resolution": [
      "/boot"
    ],
    "category": "lpic-101",
    "tags": ["filesystem"]
  },
  {
    "title": "Which manual shows information about the Linux filesystem hierachy? (Name of the manual page only)",
    "explanation": "man hier shows the description of the Linux filesystem hierachy.",
    "code_block": "",
    "kind": "text",
    "difficulty": "7",
    "answers": [
      {
        "content": "",
        "explanation": ""
      }
    ],
    "category": "lpic-101",
    "tags": ["filesystem"],
    "resolution": [
      "hier"
    ]
  },
  {
    "title": "Which boot loader probably uses the following syntax?",
    "explanation": "",
    "code_block": "title Gentoo 5.1.0\nlinux /vmlinuz-5.1.0-gentoo\ninitrd /initramfs-genkernel-x86_64-5.1.0-gentoo\noptions domdadm dolvm crypt_root=/dev/md/gentoo:root real_root=/dev/mapper/crypt-root root=/dev/mapper/crypt-root rootfstype=ext4 root_trim=yes \n",
    "kind": "single",
    "difficulty": "7",
    "answers": [
      {
        "content": "GRUB 1",
        "explanation": "No, the GRUB 1 config consists of a single file, located normally in /boot/grub/menu.lst"
      },
      {
        "content": "GRUB 2",
        "explanation": "No, the GRUB 1 config consists of a single file, located normally in /boot/grub/grub.cfg"
      },
      {
        "content": "Lilo",
        "explanation": "No, the lilo.conf used equal signs between their values."
      },
      {
        "content": "systemd-boot",
        "explanation": "Correct, this is a definition of a boot loader entry for systemd-boot (previously Gummiboot)"
      },
      {
        "content": "rEFInd",
        "explanation": "No, the rEFInd uses an ini like syntax"
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      3
    ]
  },
  {
    "title": "How do you create an LVM2 volume group?",
    "category": "lpic-101",
    "tags": ["filesystem"],
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "7",
    "answers": [
      {
        "content": "pvcreate",
        "explanation": "pvcreate initializes a (physical) volume for use by LVM."
      },
      {
        "content": "lvcreate",
        "explanation": "lvcreate creates a logical volume on an existing volume group."
      },
      {
        "content": "mkvg",
        "explanation": "LVM2 uses create, not make."
      },
      {
        "content": "vgcreate",
        "explanation": "Correct, vgcreate creates a volume group. You have to initialize a physical volume with pvcreate first."
      },
      {
        "content": "mkfs",
        "explanation": "mkfs - MaKe FileSystem formats a partition."
      }
    ],
    "resolution": [
      3
    ]
  },
  {
    "title": "How do you generate the GRUB configuration? (Version 2, Command only, no parameters)",
    "category": "lpic-101",
    "tags": ["boot"],
    "explanation": "grub-mkconfig -o /boot/grub/grub.cfg - grub-mkconfig generates the GRUB2 configuration and prints it to the standard output.",
    "code_block": "",
    "kind": "text",
    "difficulty": "7",
    "answers": [
    ],
    "resolution": [
      "grub-mkconfig"
    ],
    "comment": ""
  },
  {
    "title": "How do you install Grub into the MBR of the first mass storage device?",
    "category": "lpic-101",
    "tags": ["boot"],
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "grub-install /dev/sdb",
        "explanation": "This would install GRUB into the MBR of the second hard drive."
      },
      {
        "content": "install-grub /dev/sda",
        "explanation": "The other way around."
      },
      {
        "content": "grub-install --target=x86_64-efi --efi-directory=/boot/EFI",
        "explanation": "This would install GRUB for UEFI."
      },
      {
        "content": "update-grub /dev/sda",
        "explanation": "No"
      },
      {
        "content": "grub-install /dev/sda",
        "explanation": "Correct, this would install GRUB into the MBR of the first mass storage device."
      }
    ],
    "resolution": [
      4
    ]
  },
  {
    "title": "What would be the best way to print out the MBR of the first mass storage device?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "5",
    "answers": [
      {
        "content": "hexdump -C -n 512 /dev/sda",
        "explanation": "Correct, this would dump the first 512 bytes of the first mass storage device and display it with hexdump in ASCII mode."
      },
      {
        "content": "dd if=/dev/sda of=mbr.txt bs=512 count=1",
        "explanation": "This would save the MBR to a mbr.txt file."
      },
      {
        "content": "cat /dev/sda",
        "explanation": "Bad idea"
      },
      {
        "content": "head -n 512 /dev/sda",
        "explanation": "This would output the first 512 lines the device, probably containing the MBR, but a lot of other junk too."
      },
      {
        "content": "tail -n 512 /dev/sda",
        "explanation": "This would output the last 512 lines of the device."
      }
    ],
    "category": "lpic-101",
    "tags": ["boot"],
    "resolution": [
      0
    ]
  },
  {
    "title": "Which file ending do shared libraries have on Linux?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": ".dll",
        "explanation": "This would be the windows version."
      },
      {
        "content": ".sl",
        "explanation": "No"
      },
      {
        "content": "None (Linux files have no file ending).",
        "explanation": "No, certain files do have file endings in Linux."
      },
      {
        "content": ".ko",
        "explanation": "This would be kernel drivers / modules."
      },
      {
        "content": ".so",
        "explanation": "Correct. shared libraries end with .so (shared object)"
      }
    ],
    "category": "lpic-101",
    "tags": ["library"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which command probably generated the following output? (Command only)",
    "category": "lpic-101",
    "tags": ["library"],
    "explanation": "ldd prints shared object / library dependencies. `ldd $(which cp)`",
    "code_block": "linux-vdso.so.1 (0x00007ffe5e995000)\nlibacl.so.1 => /lib64/libacl.so.1 (0x00007fd72d962000)\nlibattr.so.1 => /lib64/libattr.so.1 (0x00007fd72d75c000)\nlibc.so.6 => /lib64/libc.so.6 (0x00007fd72d587000)\n/lib64/ld-linux-x86-64.so.2 (0x00007fd72dbc4000)",
    "kind": "text",
    "difficulty": "7",
    "answers": [
    ],
    "resolution": [
      "ldd"
    ]
  },
  {
    "title": "Which command shows you printable character sequences in an Linux executable?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "8",
    "answers": [
      {
        "content": "file",
        "explanation": "file determines the file type."
      },
      {
        "content": "cat",
        "explanation": "concatenate just prints the whole file. (including non-printable chars)"
      },
      {
        "content": "less",
        "explanation": "less just dumps the whole file (including non-printable chars) in an non-editq vi frontend."
      },
      {
        "content": "hexdump",
        "explanation": "hexdump, while a very useful tool, also displays the whole file contents in hexadecimal (or decimal, octal or ascii)"
      },
      {
        "content": "strings",
        "explanation": "Correct, strings prints printable characters in files with at least 4 characters by default. Also useful for data files etc."
      }
    ],
    "category": "lpic-101",
    "tags": ["library"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which file probably contains the following content?",
    "explanation": "",
    "code_block": "## Major bug fix updates produced after the final release of the\n## distribution.\ndeb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted\n# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted\n\n## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu\n## team. Also, please note that software in universe WILL NOT receive any\n## review or updates from the Ubuntu security team.\ndeb http://archive.ubuntu.com/ubuntu/ bionic universe\n# deb-src http://archive.ubuntu.com/ubuntu/ bionic universe\ndeb http://archive.ubuntu.com/ubuntu/ bionic-updates universe",
    "kind": "single",
    "difficulty": "2",
    "answers": [
      {
        "content": "/etc/apt/sources.list",
        "explanation": "Correct, the sources.list contains the mirror servers for the apt package management system on Debian, Ubuntu etc."
      },
      {
        "content": "/etc/yum.repos.d/centos-base.repo",
        "explanation": "No, this one of the configuration files for CentOS."
      },
      {
        "content": "/etc/pacman.d/mirrorlist",
        "explanation": "This would be the mirror selection file for Arch Linux."
      },
      {
        "content": "/etc/nsswitch.conf",
        "explanation": "No, that's the configuration file for the GNU Name Service Switch functionality."
      },
      {
        "content": "/etc/portage/make.conf",
        "explanation": "This is the configuration file for the Gentoo portage / emerge system."
      }
    ],
    "category": "lpic-101",
    "tags": ["package"],
    "resolution": [
      0
    ]
  },
  {
    "title": "How can you get more information, like the maintainer, about an apt package on Debian?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "apt-cache show pkg",
        "explanation": "apt-cache show displays the package records for the given package(s)."
      },
      {
        "content": "apt-cache info pkg",
        "explanation": "It would be info on yum / dnf, not on apt."
      },
      {
        "content": "apt-cache search pkg",
        "explanation": "This would display the package and it's description, but not the whole information."
      },
      {
        "content": "apt-info pkg",
        "explanation": "This command is not existing"
      },
      {
        "content": "apt-show pkg",
        "explanation": "This command is not existing"
      }
    ],
    "category": "lpic-101",
    "tags": ["package"],
    "resolution": [
      0
    ]
  },
  {
    "title": "How can you delete an package including it's configuration?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "apt-get remove pkg",
        "explanation": "This would uninstall the package, but leave the configuration file on the system."
      },
      {
        "content": "apt-get clean pkg",
        "explanation": "apt-get clean (without pkg) removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial"
      },
      {
        "content": "apt-get purge pkg",
        "explanation": "Purge is identical to remove, but also deletes configuration files too (not in home directories)."
      },
      {
        "content": "apt-get force-remove pkg",
        "explanation": "Not existing"
      },
      {
        "content": "apt-get autoclean pkg",
        "explanation": "apt-get autoclean would remove packages which are no longer in use."
      }
    ],
    "category": "lpic-101",
    "tags": ["package"],
    "resolution": [
      2
    ]
  },
  {
    "title": "How can you reconfigure the available languages on a Debian system?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "apt-get reinstall language",
        "explanation": "No, there is no package language."
      },
      {
        "content": "dpkg-reconfigure locales",
        "explanation": "Correct, this would open a window asking you to select the languages you want to have available."
      },
      {
        "content": "vim /etc/locale.gen",
        "explanation": "The locale-gen command, which you need to execute afterwards, is missing and you generally should prefer using dpkg-reconfigure."
      },
      {
        "content": "locale-gen",
        "explanation": "This would generate the locales based on the /etc/locale.gen file, but not add new languages."
      },
      {
        "content": "export LANG=\"my_new_language\"",
        "explanation": "This would overwrite the LANG environment variable (/etc/locale.conf) to a new language, but not add any new."
      }
    ],
    "category": "lpic-101",
    "tags": ["package"],
    "resolution": [
      1
    ]
  },
  {
    "title": "How can you list all installed packages on an Debian system?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "apt-get installed",
        "explanation": "This is not existing."
      },
      {
        "content": "apt-cache pkgnames",
        "explanation": "This shows all available packages."
      },
      {
        "content": "apt-cache list",
        "explanation": "There is no such operation, there is `apt list --installed` in newer Ubuntu versions (14.04)."
      },
      {
        "content": "dpkg list",
        "explanation": "dpkg is not having the same syntax as apt, so you need to use parameters."
      },
      {
        "content": "dpkg -l",
        "explanation": "dpkg -l shows the installed packages, as an alternative you can also use dpkg --get-selections."
      }
    ],
    "category": "lpic-101",
    "tags": ["package"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which of the following commands belong to the Debian package management system?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "3",
    "answers": [
      {
        "content": "apt-get",
        "explanation": "With apt-get you can manage the systems packages."
      },
      {
        "content": "apt-cache",
        "explanation": "With apt-cache you can find information on packages."
      },
      {
        "content": "apt-remove",
        "explanation": "There is no such command"
      },
      {
        "content": "yum",
        "explanation": "This is the RHEL / Centos package manager (Before Version 8)"
      },
      {
        "content": "dpkg-reconfigure",
        "explanation": "With dpkg-reconfigure you can reconfigure already installed packages."
      },
      {
        "content": "zypper",
        "explanation": "This is the package manage of Suse."
      },
      {
        "content": "rpm",
        "explanation": "rpm is the RPM package manager (like dpkg) for distributions using rpm files."
      }
    ],
    "category": "lpic-101",
    "tags": ["package"],
    "resolution": [
      0,
      1,
      4
    ]
  },
  {
    "title": "How do you update your system with yum? Shows the most suitable one.",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "yum update && yum upgrade",
        "explanation": "No, though this would update and upgrade your system, with yum you only have to use one command. yum update and upgrade (deprecated) is the same. This would be apt-get way."
      },
      {
        "content": "yum update",
        "explanation": "This updates the package lists and upgrades every currently installed package on the system."
      },
      {
        "content": "yum distupgrade",
        "explanation": "This does not exist."
      },
      {
        "content": "yum updatepackages",
        "explanation": "This does not exist."
      },
      {
        "content": "yum -Syu",
        "explanation": "This does not exist."
      }
    ],
    "category": "lpic-101",
    "tags": ["package"],
    "resolution": [
      1
    ]
  },
  {
    "title": "Which command lists the files in an installed RPM packages",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "5",
    "answers": [
      {
        "content": "rpm -ql",
        "explanation": "rpm -q -l shows you the files from an installed rpm."
      },
      {
        "content": "rpm2cpio",
        "explanation": "This would extract an cpio archive from the package (but you would still need to extract that too)."
      },
      {
        "content": "rpm --list-files",
        "explanation": "This is not existing."
      },
      {
        "content": "rpm --query-files",
        "explanation": "This is not existing."
      },
      {
        "content": "rpm -i",
        "explanation": "This would install an rpm package."
      }
    ],
    "category": "lpic-101",
    "tags": ["package", "yum"],
    "resolution": [
      0
    ]
  },
  {
    "title": "To which package manager the following snippet probably belongs? (Command only)",
    "explanation": "yum the package manager of RHEL or CentOS (Before Version 8) is using this configuration format for it's repository configuration.",
    "code_block": "[base]\nname=CentOS-$releasever - Base\nmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra\n#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/\ngpgcheck=1\ngpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7",
    "kind": "text",
    "difficulty": "4",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["package", "yum"],
    "resolution": [
      "yum"
    ]
  },
  {
    "title": "Which of the following files (if existing) are normally loaded during the startup of the Bourne-Again Shell (bash)?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "5",
    "answers": [
      {
        "content": "/etc/skel",
        "explanation": "No, the /etc/skel directory contains the skeleton files for newly created users with home directory (They are copied there)."
      },
      {
        "content": "/etc/profile",
        "explanation": "Correct, the /etc/profile file is the base configuration loaded not only for the bash, but for most shells."
      },
      {
        "content": "~/profile",
        "explanation": "No, there is a dot missing. If existing ~/.profile is loaded too."
      },
      {
        "content": "~/.bashrc",
        "explanation": "Correct this is the Bash startup file of the user, where they can override settings and add their own things."
      },
      {
        "content": "/etc/bash",
        "explanation": "This is not existing, it's either /etc/bashrc or a configuration directory for the bash."
      },
      {
        "content": "~/.xinitrc",
        "explanation": "The ~/.xinitrc is used to run (GUI) programs and set environment variables on the X server (xorg) startup."
      }
    ],
    "category": "lpic-101",
    "tags": ["bash"],
    "resolution": [
      1,
      3
    ]
  },
  {
    "title": "How do you delete an Variable on the bash? (Command only)",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "remove",
        "explanation": "There is no such command."
      },
      {
        "content": "rm",
        "explanation": "This would delete files."
      },
      {
        "content": "unset",
        "explanation": "With unset you delete an environment variable from the shell."
      },
      {
        "content": "clear",
        "explanation": "clears the terminal screen (like Ctrl + L)"
      },
      {
        "content": "uname",
        "explanation": "Prints system and Kernel information"
      }
    ],
    "category": "lpic-101",
    "tags": ["bash"],
    "resolution": [
      2
    ]
  },
  {
    "title": "How would you extend the list of directories, where the shell is looking for executable files, with your users \"~/bin\" folder?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "expand PATH:~/bin",
        "explanation": "expand converts tabs to spaces."
      },
      {
        "content": "export PATH:~/bin",
        "explanation": "It's KEY=Value"
      },
      {
        "content": "export PATH=$PATH;~/bin",
        "explanation": "The path variable is using the colon for separation"
      },
      {
        "content": "export $PATH=PATH:~/bin",
        "explanation": "If ever working (not allowed variable name) this would set the content of your PATH variable as an variable with the text PATH:~/bin"
      },
      {
        "content": "export PATH=\"$PATH:~/bin\"",
        "explanation": "This extends the PATH variable with your users ~/bin folder."
      },
      {
        "content": "export PATH=\"PATH:~/bin\"",
        "explanation": "This would screw up your PATH variable with the text PATH and your users bin folder."
      }
    ],
    "category": "lpic-101",
    "tags": ["bash"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which Environment Variable holds the language configuration for the shell? (Name only)",
    "explanation": "LANG is the correct answer, you can print it with echo $LANG",
    "code_block": "",
    "kind": "text",
    "difficulty": "4",
    "answers": [
    ],
    "resolution": [
      "LANG"
    ],
    "category": "lpic-101",
    "tags": ["bash"]
  },
  {
    "title": "How can you display all environment variables?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "4",
    "answers": [
      {
        "content": "echo *",
        "explanation": "This would display all files and directories in the current folder."
      },
      {
        "content": "echo $?",
        "explanation": "This would display the exit code of the last command."
      },
      {
        "content": "export *",
        "explanation": "This would try to export all files to an environment variable (empty Strings)."
      },
      {
        "content": "set",
        "explanation": "set without any parameters prints all local-, global environment variables and definitions."
      },
      {
        "content": "env",
        "explanation": "Correct env without options will print the Environment variables."
      }
    ],
    "category": "lpic-101",
    "tags": ["bash"],
    "resolution": [
      3,
      4
    ]
  },
  {
    "title": "Which command shows you the full path of a command (e.g. /bin/ls)?",
    "category": "lpic-101",
    "tags": ["bash"],
    "explanation": "`which` shows the full path of commands. `whereis` would also show you other paths (like to the man page)",
    "code_block": "",
    "kind": "text",
    "difficulty": "3",
    "answers": [
    ],
    "resolution": [
        "which"
    ]
  },
  {
    "title": "In which file is the users bash history stored?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "/etc/bash_history",
        "explanation": "It's about the user! And this file is not existing too."
      },
      {
        "content": "/var/log/syslog",
        "explanation": "It's about the user."
      },
      {
        "content": "~/.history",
        "explanation": "This file is not existing"
      },
      {
        "content": "~/.bash_history",
        "explanation": "The users input history of the bash is stored in ~/.bash_history by default."
      },
      {
        "content": "~/.bashrc",
        "explanation": "The bashrc contains is the users startup file for the Bash."
      }
    ],
    "category": "lpic-101",
    "tags": ["bash"],
    "resolution": [
      3
    ]
  },
  {
    "title": "Which section number has the manual for the /etc/fstab file?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "7",
    "answers": [
      {
        "content": "1",
        "explanation": "1 would be executable programs or shell commands."
      },
      {
        "content": "8",
        "explanation": "8 are system administration commands."
      },
      {
        "content": "6",
        "explanation": "6 was intended to be for games."
      },
      {
        "content": "4",
        "explanation": "4 is for special files (mostly files in /dev)"
      },
      {
        "content": "5",
        "explanation": "5 is for file formats and file descriptions, like /etc/fstab - man fstab"
      }
    ],
    "category": "lpic-101",
    "tags": ["man"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which of the following will print your current directory position on the shell?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "4",
    "answers": [
      {
        "content": "pwd",
        "explanation": "The pwd command prints out the current working directory."
      },
      {
        "content": "echo $PWD",
        "explanation": "The Environment Variable PWD contains the current working directory."
      },
      {
        "content": "echo $(pwd)",
        "explanation": "Yes, you can use the command substitution mode with echo to get the current working directory."
      },
      {
        "content": "echo PWD",
        "explanation": "This is going to output PWD as text."
      },
      {
        "content": "w",
        "explanation": "w prints the current logged in users"
      },
      {
        "content": "whereis",
        "explanation": "whereis locates binary, source and the manual page files for a command."
      }
    ],
    "category": "lpic-101",
    "tags": ["bash"],
    "resolution": [
      0,
      1,
      2
    ]
  },
  {
    "title": "Which command probably printed the following? (No parameters, command only)",
    "explanation": "uname -a displays the Kernel version, the architecture, the hostname and some other information about the system.",
    "code_block": "Linux byteeTR2 5.1.0-gentoo #1 SMP PREEMPT Wed May 8 08:03:10 CEST 2019 x86_64 AMD Ryzen Threadripper 2990WX 32-Core Processor AuthenticAMD GNU/Linux\n",
    "kind": "text",
    "difficulty": "6",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["kernel"],
    "resolution": [
      "uname"
    ]
  },
  {
    "title": "What would be the output of the following echo command?",
    "explanation": "",
    "code_block": "$ EXAM=\"LPIC 101\"\n$ echo 'Exam: \"$EXAM\"'",
    "kind": "single",
    "difficulty": 6,
    "category": "lpic-101",
    "tags": ["bash"],
    "answers": [
      {
        "content": "Exam: \"$EXAM\"",
        "explanation": "Correct, in single quotes Variables are not evaluated and the double quotes are printed as text. Use double quotes around the whole statement instead."
      },
      {
        "content": "Exam:",
        "explanation": "No, this would happen if the environment variable is not existing and you would use double quotes."
      },
      {
        "content": "Exam: \"LPIC 101\"",
        "explanation": "No, you need to use double quotes for that. In single quotes Variables are not evaluated."
      },
      {
        "content": "An error would occur",
        "explanation": "No, the syntax is correct, even if the result is not what you want."
      },
      {
        "content": "Exam: LPIC 101",
        "explanation": "No, the double quotes are displayed as text only and the variable is not evaluated."
      }
    ],
    "resolution": [
      0
    ]
  },
  {
    "title": "How do you get the MD5 checksum of a file for validating a download? (Command only)",
    "category": "lpic-101",
    "tags": ["command"],
    "explanation": "md5sum file would give you the md5 checksum a file.",
    "code_block": "",
    "kind": "text",
    "difficulty": "5",
    "answers": [
    ],
    "resolution": [
      "md5sum"
    ]
  },
  {
    "title": "How do you display the first lines of a file? (No parameters, command only)",
    "explanation": "head without parameters prints the first ten lines of a file.",
    "code_block": "",
    "kind": "text",
    "difficulty": "3",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["Command"],
    "resolution": [
      "head"
    ]
  },
  {
    "title": "How do you display the last lines of a file? (Command only, no parameters)",
    "explanation": "tail shows the last 10 lines of a given file.",
    "code_block": "",
    "kind": "text",
    "difficulty": "3",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["Command"],
    "resolution": [
      "tail"
    ]
  },
  {
    "title": "Which command shows you the number of lines of a file? (Not the file itself)",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "nl",
        "explanation": "nl prints the file with line numbers on the beginning."
      },
      {
        "content": "wc",
        "explanation": "Correct, wc shows you the number of lines, word and char-count of a file. wc -l would only output the number of lines."
      },
      {
        "content": "zcat",
        "explanation": "zcat prints out the file contents of a compressed file."
      },
      {
        "content": "uniq",
        "explanation": "uniq reports or omits repeated / duplicate lines."
      },
      {
        "content": "tr",
        "explanation": "tr replaces or deletes characters."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      1
    ]
  },
  {
    "title": "What would the following do? `echo * | tr \" \" \"\\n\" | head -n 1`",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "2",
    "answers": [
      {
        "content": "Get the first Environment Variable and print it.",
        "explanation": "No, env | head -1 could do that."
      },
      {
        "content": "Print all files and directories in the current directory.",
        "explanation": "No, echo * does that."
      },
      {
        "content": "Print all Environment Variables",
        "explanation": "No, env would do that."
      },
      {
        "content": "Print the first file or directory in your current directory.",
        "explanation": "Correct, echo * prints files / directories in your current folder, with tr you replace the space with a newline character and head -1 prints the first line."
      },
      {
        "content": "An syntax error would occur",
        "explanation": "No, the syntax is correct."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      3
    ]
  },
  {
    "title": "Which command allows you to reverse sort the lines of a text file?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "rsort",
        "explanation": "This command does not exist."
      },
      {
        "content": "usort",
        "explanation": "This command does not exist."
      },
      {
        "content": "reverse",
        "explanation": "This command does not exist."
      },
      {
        "content": "sort",
        "explanation": "Correct, sort with -r let's you reversely sort a file / input (by lines)."
      },
      {
        "content": "uniq",
        "explanation": "uniq is for handling duplicate lines."
      },
      {
        "content": "nl",
        "explanation": "nl numbers lines."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      3
    ]
  },
  {
    "title": "Which of the following does touch not do?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "3",
    "answers": [
      {
        "content": "Create an empty file",
        "explanation": "touch can create an empty file."
      },
      {
        "content": "Update the created time of an existing file",
        "explanation": "touch modifies the access and modified time, but not the created time of an existing file."
      },
      {
        "content": "Update the access and modification time of a directory",
        "explanation": "touch also sets the times on a directory."
      },
      {
        "content": "Update the access and modification time of a file",
        "explanation": "touch sets the times on a file."
      },
      {
        "content": "Create a directory",
        "explanation": "touch would create file, if the file / directory is not existing, not an directory."
      },
      {
        "content": "Create a file with an modified access date.",
        "explanation": "Touch can do that."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      1,
      4
    ]
  },
  {
    "title": "You can add -r to the move (mv) command?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "True",
        "explanation": "No, there is no such option / parameter and you would get an syntax error."
      },
      {
        "content": "False",
        "explanation": "There is no parameter -r for mv."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      1
    ]
  },
  {
    "title": "Which commands determines the file type of a given file? (Command only)",
    "explanation": "file tests for the file type and prints it out.",
    "code_block": "",
    "kind": "text",
    "difficulty": "3",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      "file"
    ]
  },
  {
    "title": "How would you create an Backup of your MBR of your first mass storage device?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "head -n 512 /dev/sda > mbr-backup",
        "explanation": "This would read the first 512 lines of the device as text."
      },
      {
        "content": "hexdump -n 512 -C > mbr-backup",
        "explanation": "No, hexdump is useful for showing the MBR but not for saving it."
      },
      {
        "content": "dd if=/dev/sda of=mbr-backup bs=512 count=1",
        "explanation": "Correct, dd is the best way to make a binary copy of the MBR."
      },
      {
        "content": "gzip -n 512 /dev/sda > mbr-backup",
        "explanation": "Just no."
      },
      {
        "content": "tar cvf /dev/sda sda-backup",
        "explanation": "No"
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      2
    ]
  },
  {
    "title": "Which of the following would create a backup of your user home directory?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "5",
    "answers": [
      {
        "content": "tar xf backup.tar ~",
        "explanation": "This would extract a file called backup.tar."
      },
      {
        "content": "tar xf ~ backup.tar",
        "explanation": "This would try to extract a file ~."
      },
      {
        "content": "tar cvf ~ backup.tar",
        "explanation": "This would try to create a file ~ with the content of backup.tar"
      },
      {
        "content": "tar -cf backup.tar /home",
        "explanation": "This would create a backup of the whole /home directory, probably including the one of your user, but also everyone else."
      },
      {
        "content": "tar cvf backup.tar ~",
        "explanation": "This is create a backup of your home directory to the backup.tar file. (create, verbose, file)"
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which of the following are common compression tools on Linux?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "4",
    "answers": [
      {
        "content": "xzip",
        "explanation": "Does not exist."
      },
      {
        "content": "xz",
        "explanation": "Correct, xz is one of the strongest compression tools on Linux currently."
      },
      {
        "content": "gzip",
        "explanation": "Correct, gzip is a compression tool."
      },
      {
        "content": "bz2",
        "explanation": "That's just the file ending, bzip2 is the command."
      },
      {
        "content": "bunzip2",
        "explanation": "Correct, bunzip2 is existing."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      1,
      2,
      4
    ]
  },
  {
    "title": "mkdir test/test2/test3 would create non existing parent directories too?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "1",
    "answers": [
      {
        "content": "True",
        "explanation": "No, you need to add -p for it."
      },
      {
        "content": "False",
        "explanation": "Yes, you need to add -p or --parents in order to create needed parent directories."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      1
    ]
  },
  {
    "title": "How do you search for modified things in the last 1 minute in the current directory?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "find . -mmin -1",
        "explanation": "Correct -mmin -1 would search for files modified in the last minute."
      },
      {
        "content": "find . -mtime -1",
        "explanation": "This would search for files modified in the last day."
      },
      {
        "content": "find . -mmin 1",
        "explanation": "This would search for files modified exactly one minute ago."
      },
      {
        "content": "find . -mmin +1",
        "explanation": "This searches for files which are not modified one minute ago."
      },
      {
        "content": "find -mtime -1 .",
        "explanation": "No, finds syntax requires the folder to search for before the expression."
      },
      {
        "content": "find -mmin -1 .",
        "explanation": "No, finds syntax requires the folder to search for before the expression."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      0
    ]
  },
  {
    "title": "Which of the following redirects the standard and error output to a file?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": ">",
        "explanation": "This only redirects the standard output"
      },
      {
        "content": "2>",
        "explanation": "This only redirects the error output"
      },
      {
        "content": ">>",
        "explanation": "This redirects the output and appends it."
      },
      {
        "content": "<",
        "explanation": "This reads the input."
      },
      {
        "content": "&>",
        "explanation": "This redirects the standard and error output."
      }
    ],
    "category": "lpic-101",
    "tags": ["redirect"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which of the following prints to stdout and writes to a file simultaneously?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "&>",
        "explanation": "This redirects the standard and error output."
      },
      {
        "content": "2>",
        "explanation": "This redirects the error output."
      },
      {
        "content": "tee",
        "explanation": "tee writes to file and outputs simultaneously."
      },
      {
        "content": "xargs",
        "explanation": "xargs buils command line options from the standard input."
      }
    ],
    "category": "lpic-101",
    "tags": ["redirect"],
    "resolution": [
      2
    ]
  },
  {
    "title": "Which kill signal is send by default by the kill command? (If no other supplied)",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "5",
    "answers": [
      {
        "content": "-9",
        "explanation": "This is the SIGKILL signal."
      },
      {
        "content": "-1",
        "explanation": "This is the SIGHUP (reload configuration) signal."
      },
      {
        "content": "-USR1",
        "explanation": "This would be the SIGUSR1 signal, you can send it for example to dd to get a status."
      },
      {
        "content": "-10",
        "explanation": "This would be the SIGUSR1 command."
      },
      {
        "content": "-15",
        "explanation": "This is the default signal send, if no other specified. It's called SIGTERM."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      4
    ]
  },
  {
    "title": "Which of the following are bash programs to manage jobs?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "4",
    "answers": [
      {
        "content": "jobs",
        "explanation": "The jobs command shows the currently running bash jobs."
      },
      {
        "content": "fg",
        "explanation": "fg jobid would bring a running job to the foreground."
      },
      {
        "content": "bg",
        "explanation": "bg jobid would continue running a job in the background (paused on)."
      },
      {
        "content": "background",
        "explanation": "No, it's bg."
      },
      {
        "content": "foreground",
        "explanation": "No, it's fg."
      },
      {
        "content": "kill",
        "explanation": "While kill could kill a running job, it does not belong to the builtin bash job commands."
      }
    ],
    "category": "lpic-101",
    "tags": ["bash"],
    "resolution": [
      0,
      1,
      2
    ]
  },
  {
    "title": "bg is an built in bash command? E.g. no regular executable.",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "True",
        "explanation": "bg is an built-in bash command and no stand alone executable."
      },
      {
        "content": "False",
        "explanation": "No, bg is no stand alone executable. (which bg)"
      }
    ],
    "category": "lpic-101",
    "tags": ["bash"],
    "resolution": [
      0
    ]
  },
  {
    "title": "How do you display the used memory of a Linux computer? (No parameters)",
    "explanation": "free displays the used and available memory. (Tip: Use it with -h)",
    "code_block": "",
    "kind": "text",
    "difficulty": "4",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      "free"
    ]
  },
  {
    "title": "How can you view all running processes?",
    "category": "lpic-101",
    "tags": ["command"],
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "3",
    "answers": [
      {
        "content": "ps",
        "explanation": "Correct ps reports a snapshot of the current processes (e.g. ps aux)."
      },
      {
        "content": "top",
        "explanation": "Yes, top also displays running processes in a task manager style."
      },
      {
        "content": "free",
        "explanation": "free shows information about the systems memory."
      },
      {
        "content": "watch",
        "explanation": "watch allows you to execute a program periodically. (every 2 seconds by default)"
      },
      {
        "content": "iftop",
        "explanation": "iftop shows the current bandwidth usage on a network interface."
      }
    ],
    "resolution": [
      0,
      1
    ]
  },
  {
    "title": "Which command allows you to periodically execute a program and monitor at it's output (For example ps every 5 seconds)? (Command only)",
    "explanation": "watch allows to execute a program periodically and prints it output full screen. (every 2 seconds by default)",
    "code_block": "",
    "kind": "text",
    "difficulty": "5",
    "answers": [
      {
        "content": "",
        "explanation": ""
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      "watch"
    ]
  },
  {
    "title": "Which program probably generated the following output?",
    "explanation": "uptime shows how long the system has been running. top shows it too, but also contains a lot of other output.",
    "code_block": " 12:08:51 up 4 days,  2:03,  1 user,  load average: 0.47, 0.75, 0.69",
    "kind": "text",
    "difficulty": "3",
    "answers": [
      {
        "content": "",
        "explanation": ""
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      "uptime"
    ]
  },
  {
    "title": "Which of the following are valid nice values?",
    "category": "lpic-101",
    "tags": ["nice"],
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": 0,
    "answers": [
      {
        "content": "19",
        "explanation": "19 is a valid nice value (-20 to 19)"
      },
      {
        "content": "0",
        "explanation": "0 is a valid nice value (-20 to 19)"
      },
      {
        "content": "-20",
        "explanation": "-20 is a valid nice value (-20 to 19)"
      },
      {
        "content": "20",
        "explanation": "20 is not a valid nice value."
      },
      {
        "content": "-127",
        "explanation": "No"
      },
      {
        "content": "255",
        "explanation": "No"
      },
      {
        "content": "127",
        "explanation": "No"
      }
    ],
    "resolution": [
      0,
      1,
      2
    ]
  },
  {
    "title": "Which of the following commands allows you to change the nice value of a running command?",
    "category": "lpic-101",
    "tags": ["command", "nice"],
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "nice",
        "explanation": "With nice you can set the value BEFORE starting it."
      },
      {
        "content": "ps",
        "explanation": "ps shows running processes."
      },
      {
        "content": "top",
        "explanation": "Yes, top allows you to change the nice value. Just like the renice command."
      },
      {
        "content": "rn",
        "explanation": "This command does not exist."
      },
      {
        "content": "watch",
        "explanation": "watch allows you to periodically execute a command."
      }
    ],
    "resolution": [
      2
    ]
  },
  {
    "title": "The dot \".\" in a regex matches a single character?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "True",
        "explanation": "The dot matches any single character."
      },
      {
        "content": "False",
        "explanation": "No."
      }
    ],
    "category": "lpic-101",
    "tags": ["regex"],
    "resolution": [
      0
    ]
  },
  {
    "title": "A regex with \"a*\" would match all words starting with an a?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "True",
        "explanation": "No, that would be a.*"
      },
      {
        "content": "False",
        "explanation": "It would match unlimited a's. The * matches zero or more occurrences of the previous character."
      }
    ],
    "category": "lpic-101",
    "tags": ["regex"],
    "resolution": [
      1
    ]
  },
  {
    "title": "Which operator matches the end of lines in an regex?",
    "explanation": "The $ matches the end of lines.",
    "code_block": "",
    "kind": "text",
    "difficulty": "7",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["regex"],
    "resolution": [
      "$"
    ]
  },
  {
    "title": "Which regex operator matches the beginning of a line?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "^",
        "explanation": "The ^ operator matches the beginning, careful it also can be used to negate a statement (depending on language)."
      },
      {
        "content": "$",
        "explanation": "The dollar matches the end of a line."
      },
      {
        "content": ".",
        "explanation": "The dot matches any character."
      },
      {
        "content": "*",
        "explanation": "Matches zero or more of the previous character."
      },
      {
        "content": "[]",
        "explanation": "Matches any of the character gives in the brackets. [a-z] matches all lower case characters."
      }
    ],
    "category": "lpic-101",
    "tags": ["regex"],
    "resolution": [
      0
    ]
  },
  {
    "title": "Which command allows you to print lines that match an given pattern? (Basic command only, not the variants)",
    "explanation": "grep allows you to print only lines containing a pattern.",
    "code_block": "",
    "kind": "text",
    "difficulty": "2",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["regex", "command"],
    "resolution": [
      "grep"
    ]
  },
  {
    "title": "Which grep parameter negates the pattern, e.g. showing all lines NOT containing it?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "-i",
        "explanation": "-i makes the search case insensitive."
      },
      {
        "content": "-v",
        "explanation": "-v inverts the result."
      },
      {
        "content": "-r",
        "explanation": "-r recursively searches all files under the directory."
      },
      {
        "content": "-A",
        "explanation": "-A 3 would also show 3 lines after a match."
      },
      {
        "content": "-B",
        "explanation": "-B 3 would also show 3 lines before a match."
      }
    ],
    "category": "lpic-101",
    "tags": ["command"],
    "resolution": [
      1
    ]
  },
  {
    "title": "How would you start the editing mode after the current position of your cursor in vi?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "3",
    "answers": [
      {
        "content": "i",
        "explanation": "i starts the editing mode at the current position of the cursor."
      },
      {
        "content": "a",
        "explanation": "a starts the editing mode after the current position of the cursor."
      },
      {
        "content": "o",
        "explanation": "o starts the editing mode on a newly inserted line after the cursor."
      },
      {
        "content": "h",
        "explanation": "h would navigate the cursor one to left."
      },
      {
        "content": "l",
        "explanation": "l would navigate the cursor one to the right."
      }
    ],
    "category": "lpic-101",
    "tags": ["vi"],
    "resolution": [
      1
    ]
  },
  {
    "title": "Which Environment Variable holds the standard editor?",
    "explanation": "The EDITOR variable holds the default editor for many cli application like crontab.",
    "code_block": "",
    "kind": "text",
    "difficulty": "4",
    "answers": [
    ],
    "tags": ["bash"],
    "category": "lpic-101",
    "resolution": [
      "EDITOR"
    ]
  },
  {
    "title": "How do you cut out a line in vi? (command mode)",
    "explanation": "dd cuts a line in the command mode, with p you can paste it.",
    "code_block": "",
    "kind": "text",
    "difficulty": "4",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["vi"],
    "resolution": [
      "dd"
    ]
  },
  {
    "title": "Which of the following are Linux filesystems and are supported directly by the Kernel?",
    "explanation": "",
    "code_block": "",
    "kind": "multiple",
    "difficulty": "4",
    "answers": [
      {
        "content": "FAT",
        "explanation": "No FAT is a windows file system (which Linux can use)."
      },
      {
        "content": "NTFS",
        "explanation": "NTFS is a windows file system (which Linux can use)."
      },
      {
        "content": "Ext4",
        "explanation": "Correct, Ext4 is a Linux filesystem."
      },
      {
        "content": "Btrfs",
        "explanation": "Btrfs is a Linux filesystem."
      },
      {
        "content": "exFAT",
        "explanation": "No"
      },
      {
        "content": "ZFS",
        "explanation": "This is tricky, the license ZFS is licensed under (CDDL) is not compatible to the GPLv2 the Linux Kernel uses, because of that ZFS support is not shipped in Linux directly."
      }
    ],
    "category": "lpic-101",
    "tags": ["filesystem"],
    "resolution": [
      2,
      3
    ]
  },
  {
    "title": "How would you partition a mass storage device with an MBR (dos) partition scheme?",
    "explanation": "",
    "code_block": "",
    "kind": "single",
    "difficulty": "4",
    "answers": [
      {
        "content": "fdisk",
        "explanation": "fdisk is the MBR / dos partition tool."
      },
      {
        "content": "gdisk",
        "explanation": "gdisk is the GPT (GUID Partition Table) partition tool."
      },
      {
        "content": "cgdisk",
        "explanation": "cgdisk is a GPT (GUID Partition Table) partition tool."
      },
      {
        "content": "mkfs",
        "explanation": "With mkfs you would format (create a filesystem) a partition."
      },
      {
        "content": "mkswap",
        "explanation": "With mkswap you would create a swap partition."
      }
    ],
    "category": "lpic-101",
    "tags": ["filesystem"],
    "resolution": [
      0
    ]
  },
  {
    "title": "Which command checks an ext4 file system for errors? (Command only)",
    "explanation": "This is a tricky question. There is fsck.ext4 to explicitly check ext4 systems, but fsck is a simple frontend automatically detecting the right type.",
    "code_block": "",
    "kind": "text",
    "difficulty": "7",
    "answers": [
    ],
    "category": "lpic-101",
    "tags": ["filesystem"],
    "resolution": [
      "fsck",
      "fsck.ext4"
    ]
  }
]
