50 Free LPIC-1 Practice Questions (with Answers & Explanations)
Preparing for the LPIC-1 certification? The best way to pass is to test yourself early and often. These 50 free practice questions cover all five topic areas of the LPIC-1 101-500 and 102-500 exams.
Use these questions to:
- Identify your weak areas before exam day
- Get familiar with LPIC-1 question formats (multiple-choice, fill-in-the-blank)
- Build confidence with detailed explanations for every answer
Want the full set? We have 200+ LPIC-1 practice questions with exam simulation mode, progress tracking, and detailed performance analytics.
Topic 101: System Architecture (Questions 1–10)
Question 1
Which command displays the kernel ring buffer messages from the current boot?
a) syslog
b) dmesg
c) kernlog
d) journalctl --kernel
Show Answer
Answer: b) dmesg
Explanation: dmesg displays the kernel ring buffer, which contains boot messages, hardware detection info, and kernel-level events. While journalctl --kernel (systemd systems) can also show kernel messages, dmesg is the traditional and most direct command specified in the LPIC-1 objectives.
Question 2
What file contains the list of loaded kernel modules?
a) /proc/modules
b) /sys/modules
c) /etc/modprobe.d/modules
d) lsmod
Show Answer
Answer: a) /proc/modules
Explanation: /proc/modules shows all kernel modules currently loaded. The lsmod command reads this file and formats its output. While lsmod is more readable, the LPIC-1 exam sometimes asks about the underlying file.
Question 3
Which command loads a kernel module along with its dependencies?
a) insmod
b) modprobe
c) modload
d) depmod
Show Answer
Answer: b) modprobe
Explanation: modprobe loads a kernel module and automatically resolves and loads all dependencies. insmod loads a single module without dependency resolution. depmod generates the dependency database that modprobe uses.
Question 4
Which IRQ is traditionally assigned to the system timer on x86 systems?
a) IRQ 0
b) IRQ 1
c) IRQ 8
d) IRQ 14
Show Answer
Answer: a) IRQ 0
Explanation: IRQ 0 is reserved for the system timer (PIT — Programmable Interval Timer). IRQ 1 is for the keyboard, IRQ 8 is for the real-time clock, and IRQ 14 is for primary IDE/PATA.
Question 5
Which command lists all detected PCI devices in verbose mode?
a) lspci -v
b) lsusb -v
c) lsblk -v
d) lspci -vvv
Show Answer
Answer: a) lspci -v
Explanation: lspci -v displays PCI device information in verbose format. lspci -vv or -vvv provides even more detail but -v is the standard verbose flag specified in the LPIC-1 objectives.
Question 6
Where are device and driver information stored in a tree structure on modern Linux systems?
a) /dev/
b) /proc/
c) /sys/
d) /etc/
Show Answer
Answer: c) /sys/
Explanation: /sys/ (sysfs) provides device and driver information in a hierarchical tree structure. /proc/ contains process and system information in a flat layout. /dev/ contains device files, not driver information.
Question 7
What command displays all USB devices connected to the system in a tree format?
a) lsusb
b) lsusb -t
c) usb-tree
d) lsusb --tree
Show Answer
Answer: b) lsusb -t
Explanation: lsusb -t shows USB devices in a tree format, displaying the USB bus hierarchy. lsusb without options shows a flat list.
Question 8
Which file in /proc/ shows I/O port addresses used by devices?
a) /proc/ioports
b) /proc/io
c) /proc/ports
d) /proc/ioaddr
Show Answer
Answer: a) /proc/ioports
Explanation: /proc/ioports lists I/O port address ranges assigned to devices. Other /proc/ files relevant to hardware include /proc/interrupts (IRQs), /proc/dma (DMA channels), and /proc/cpuinfo (CPU info).
Question 9
Which file is used to blacklist a kernel module from loading automatically at boot?
a) /etc/modprobe.d/blacklist.conf
b) /etc/modprobe.d/blacklist-blacklist.conf
c) Any .conf file in /etc/modprobe.d/ with blacklist keyword
d) /etc/blacklist.conf
Show Answer
Answer: c) Any .conf file in /etc/modprobe.d/ with blacklist keyword
Explanation: You can create any .conf file in /etc/modprobe.d/ and add blacklist module_name to prevent a module from loading. The file name is arbitrary (e.g., /etc/modprobe.d/disable-beep.conf).
Question 10
On an x86 system using UEFI, where is the boot loader typically located?
a) MBR of the first disk
b) EFI System Partition (ESP)
c) /boot/ directory
d) The first logical partition
Show Answer
Answer: b) EFI System Partition (ESP)
Explanation: UEFI systems boot from the EFI System Partition (ESP), typically formatted as FAT32 and mounted at /boot/efi/ or /efi/. The ESP contains .efi boot loader files. Legacy BIOS systems use the MBR.
Topic 102: Linux Installation and Package Management (Questions 11–20)
Question 11
Which command installs a local .deb package on a Debian-based system?
a) dpkg -i package.deb
b) apt install package.deb
c) dpkg --install package.deb
d) Both a) and c)
Show Answer
Answer: d) Both a) and c)
Explanation: Both dpkg -i and dpkg --install install a local .deb package. apt install can also install local packages, but dpkg -i and dpkg --install are the direct commands specified in LPIC-1 objectives.
Question 12
Which RPM option is used to verify the integrity of all installed packages?
a) rpm -V
b) rpm --verify
c) rpm -Va
d) All of the above
Show Answer
Answer: c) rpm -Va
Explanation: rpm -Va verifies all installed packages by comparing file attributes against the RPM database. rpm -V or rpm --verify verifies specific packages (when named), not all packages. The a flag is needed to verify all packages.
Question 13
Which file defines APT repository sources on Debian-based systems?
a) /etc/apt/sources.list and files in /etc/apt/sources.list.d/
b) /etc/apt/repos.conf
c) /etc/apt.conf
d) /etc/deb-sources.list
Show Answer
Answer: a) /etc/apt/sources.list and files in /etc/apt/sources.list.d/
Explanation: APT reads repository definitions from /etc/apt/sources.list and additional .list files in /etc/apt/sources.list.d/. This modular approach allows software vendors to provide their own repository files.
Question 14
What does yum update do?
a) Updates only the package list (repository metadata)
b) Upgrades all installed packages to their latest versions
c) Removes old kernels
d) Downgrades packages to match the repository
Show Answer
Answer: b) Upgrades all installed packages to their latest versions
Explanation: yum update (or yum upgrade) upgrades all installed packages to the latest available versions. yum makecache or yum check-update refreshes the package metadata.
Question 15
Which command queries the RPM database to find which package owns the file /etc/hosts?
a) rpm -qf /etc/hosts
b) rpm -ql /etc/hosts
c) rpm -qi /etc/hosts
d) rpm -qs /etc/hosts
Show Answer
Answer: a) rpm -qf /etc/hosts
Explanation: rpm -qf (query file) determines which installed package owns a specified file. rpm -ql lists files in a package, rpm -qi shows package info, and rpm -qs shows file states.
Question 16
What is the purpose of the ldconfig command?
a) Lists all shared libraries currently loaded
b) Configures the dynamic linker run-time bindings
c) Updates the shared library cache (/etc/ld.so.cache)
d) Both b) and c)
Show Answer
Answer: d) Both b) and c)
Explanation: ldconfig creates, updates, and removes the shared library cache (/etc/ld.so.cache) used by the dynamic linker. It also configures the run-time bindings by scanning trusted directories and /etc/ld.so.conf.
Question 17
On a Debian system, what is the recommended way to remove a package and its configuration files?
a) apt remove package
b) apt purge package
c) dpkg -r package
d) apt autoremove package
Show Answer
Answer: b) apt purge package
Explanation: apt purge (or dpkg -P) removes a package and its configuration files. apt remove (or dpkg -r) removes the package but leaves configuration files behind. apt autoremove removes packages installed as dependencies that are no longer needed.
Question 18
Which YUM repository files are located where?
a) /etc/yum.repos.d/*.repo
b) /etc/yum.conf
c) /etc/yum/repos.d/
d) /var/cache/yum/
Show Answer
Answer: a) /etc/yum.repos.d/*.repo
Explanation: YUM and DNF repositories are defined in .repo files under /etc/yum.repos.d/. Each file can define one or more repositories. The main configuration file is /etc/yum.conf.
Question 19
What is the purpose of the /etc/ld.so.conf file?
a) Defines which libraries are loaded at boot
b) Lists directories to search for shared libraries
c) Configures LDAP authentication
d) Stores library version information
Show Answer
Answer: b) Lists directories to search for shared libraries
Explanation: /etc/ld.so.conf lists directories where the dynamic linker searches for shared libraries. It typically includes /etc/ld.so.conf.d/*.conf for modular configuration. The ldconfig command reads these files and builds /etc/ld.so.cache.
Question 20
Which dpkg option lists all installed packages on a Debian system?
a) dpkg -l
b) dpkg --list
c) dpkg -L
d) Both a) and b)
Show Answer
Answer: d) Both a) and b)
Explanation: Both dpkg -l and dpkg --list list all installed packages. dpkg -L lists files installed by a specific package (different function).
Topic 103: GNU and Unix Commands (Questions 21–35)
Question 21
What does the command grep -c "error" /var/log/syslog do?
a) Counts lines containing "error" (case-sensitive)
b) Counts characters of lines containing "error"
c) Counts files containing "error"
d) Counts occurrences of "error" (including multiple per line)
Show Answer
Answer: a) Counts lines containing "error" (case-sensitive)
Explanation: grep -c counts the number of lines that match the pattern (not the total number of matches — multiple matches on the same line count as 1). Use grep -o to count total matches.
Question 22
Which find option searches for files modified more than 7 days ago?
a) find / -mtime +7
b) find / -mtime -7
c) find / -ctime 7
d) find / -atime +7
Show Answer
Answer: a) find / -mtime +7
Explanation: -mtime +7 finds files modified more than 7 days ago. -mtime -7 finds files modified within the last 7 days. -mtime 7 finds files modified exactly 7 days ago. -ctime is for status changes, -atime is for access time.
Question 23
What is the difference between > and >> in bash?
a) > overwrites, >> appends
b) > redirects stdout, >> redirects stderr
c) > runs in background, >> appends
d) There is no difference
Show Answer
Answer: a) > overwrites, >> appends
Explanation: > redirects output to a file, overwriting its contents. >> redirects output to a file, appending to the end. Both redirect stdout by default.
Question 24
Which command sequences files line by line, writing them to stdout?
a) cat
b) sort
c) join
d) paste
Show Answer
Answer: a) cat
Explanation: cat (concatenate) reads files sequentially and writes them to stdout. paste merges files line by line (side by side). join joins lines based on a common field.
Question 25
What does chmod 750 script.sh do?
a) Sets permissions to rwxr-x--- (owner: read/write/execute, group: read/execute, others: none)
b) Sets permissions to rwxr-x--- (owner: read/write/execute, group: read/execute, others: read)
c) Sets permissions to rwxr-xr-x
d) Changes the file owner
Show Answer
Answer: a) Sets permissions to rwxr-x---
Explanation: 7 (owner) = rwx (4+2+1), 5 (group) = r-x (4+0+1), 0 (others) = --- (0+0+0). The resulting permissions are owner: read, write, execute; group: read, execute; others: no access.
Question 26
Which sed command replaces all occurrences of "foo" with "bar" in a file?
a) sed 's/foo/bar/' file.txt
b) sed 's/foo/bar/g' file.txt
c) sed 'y/foo/bar/' file.txt
d) sed 's/foo/bar/2' file.txt
Show Answer
Answer: b) sed 's/foo/bar/g' file.txt
Explanation: The g (global) flag replaces all occurrences on each line. Without g, only the first match per line is replaced. The y command does character transliteration (not string replacement).
Question 27
What does the tee command do?
a) Splits a file into multiple parts
b) Reads from stdin and writes to both stdout and files
c) Creates a T-shaped pipe
d) Tests whether a file exists
Show Answer
Answer: b) Reads from stdin and writes to both stdout and files
Explanation: tee reads from standard input and writes to both standard output and one or more files. Example: echo "hello" | tee file.txt displays "hello" on the terminal and writes it to file.txt.
Question 28
Which cut option uses a character delimiter to split fields?
a) cut -d ':' -f 2
b) cut -c 2-5
c) cut -b 2-5
d) cut -s ':' -f 2
Show Answer
Answer: a) cut -d ':' -f 2
Explanation: -d specifies the delimiter (field separator) and -f selects the field(s). -c selects character positions, and -b selects byte positions.
Question 29
What is the purpose of the xargs command?
a) Extracts files from an archive
b) Converts stdin to command-line arguments
c) Creates extended attributes
d) Exports variables to subprocesses
Show Answer
Answer: b) Converts stdin to command-line arguments
Explanation: xargs reads items from standard input (separated by blanks or newlines) and executes a command with those items as arguments. Example: find /tmp -name "*.tmp" | xargs rm.
Question 30
Which ps option shows all processes for all users?
a) ps aux
b) ps -ef
c) ps -A
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: All three command variants display all processes: ps aux (BSD syntax), ps -ef (standard syntax), and ps -A (all processes). LPIC-1 expects familiarity with both BSD and standard syntax.
Question 31
What signal does kill -9 send to a process?
a) SIGTERM (15)
b) SIGKILL (9)
c) SIGHUP (1)
d) SIGINT (2)
Show Answer
Answer: b) SIGKILL (9)
Explanation: kill -9 sends SIGKILL, which immediately terminates the process without allowing cleanup. SIGTERM (15) is the default and asks processes to terminate gracefully. SIGHUP (1) reloads configuration, and SIGINT (2) is triggered by Ctrl+C.
Question 32
Which command displays disk usage for each file and directory in human-readable format?
a) df -h
b) du -sh *
c) ls -lh
d) stat -h
Show Answer
Answer: b) du -sh *
Explanation: du -sh * shows disk usage (-s = summary per item, -h = human-readable) for files and directories in the current directory. df -h shows filesystem-level usage (mounted partitions).
Question 33
What does the touch command do when the file already exists?
a) Deletes the file
b) Truncates the file to zero bytes
c) Updates the access and modification timestamps
d) Creates a hard link
Show Answer
Answer: c) Updates the access and modification timestamps
Explanation: touch updates the access and modification timestamps of an existing file to the current time. If the file doesn't exist, it creates an empty file by default (with -c it skips creation for non-existent files).
Question 34
Which sort option sorts numerically (not lexicographically)?
a) sort -n
b) sort -r
c) sort -k
d) sort -g
Show Answer
Answer: a) sort -n
Explanation: sort -n sorts values as numbers rather than strings. Without it, sort treats "10" as less than "2" (lexicographic sort). sort -g handles general numeric notation (floating point, scientific).
Question 35
What is the result of the pipeline echo "hello world" | wc -w?
a) Number of bytes in "hello world"
b) Number of words in "hello world"
c) Number of lines in "hello world"
d) Number of characters in "hello world"
Show Answer
Answer: b) Number of words in "hello world"
Explanation: wc -w counts words. wc -l counts lines, wc -c counts bytes, and wc -m counts characters. The output would be 2 (two words: "hello" and "world").
Topic 104: Devices, Linux Filesystems, and FHS (Questions 36–45)
Question 36
Which filesystem is the default for modern Linux installations?
a) ext3
b) ext4
c) XFS
d) Both ext4 and XFS, depending on distribution
Show Answer
Answer: d) Both ext4 and XFS, depending on distribution
Explanation: ext4 is the default for Debian/Ubuntu, while XFS is the default for RHEL/CentOS 7+. Both are supported by the kernel. ext3 is older and no longer the default for any major distribution.
Question 37
What is the purpose of the /proc/ filesystem?
a) Stores process binaries
b) Virtual filesystem for kernel and process data
c) Contains persistent process configuration
d) Stores system backups
Show Answer
Answer: b) Virtual filesystem for kernel and process data
Explanation: /proc/ is a virtual (pseudo) filesystem that provides information about the kernel, running processes, and hardware. It doesn't occupy disk space — files are generated on-the-fly by the kernel.
Question 38
Which directory in the Filesystem Hierarchy Standard (FHS) contains variable data that persists between boots, such as mail spools and log files?
a) /var/
b) /tmp/
c) /srv/
d) /run/
Show Answer
Answer: a) /var/
Explanation: /var/ contains variable data that persists between boots (logs, mail spools, databases, printer spools). /tmp/ is for temporary files that may be deleted on reboot. /run/ contains runtime variable data for running processes. /srv/ is for site-specific data served by the system.
Question 39
What command creates an ext4 filesystem on /dev/sdb1?
a) mkfs.ext4 /dev/sdb1
b) mkfs -t ext4 /dev/sdb1
c) fscreate ext4 /dev/sdb1
d) Both a) and b)
Show Answer
Answer: d) Both a) and b)
Explanation: Both mkfs.ext4 /dev/sdb1 and mkfs -t ext4 /dev/sdb1 create an ext4 filesystem. The mkfs command uses -t to specify the filesystem type. mkfs.ext4 is a shorthand wrapper.
Question 40
Which mount option makes a filesystem read-only?
a) mount -o ro /dev/sdb1 /mnt
b) mount -r /dev/sdb1 /mnt
c) mount --read-only /dev/sdb1 /mnt
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: All three methods mount a filesystem as read-only. -o ro, -r, and --read-only are equivalent options. The most common is -o ro.
Question 41
What is the maximum file size supported by ext4?
a) 2 TB
b) 8 TB
c) 16 TB
d) 1 EB
Show Answer
Answer: c) 16 TB
Explanation: The ext4 filesystem supports individual files up to 16 TB (with 4 KB block size) and a maximum filesystem size of 1 EB. XFS supports larger file sizes (8 EB), which is why it's preferred for large data workloads.
Question 42
Which file contains the filesystem table that's read at boot to automatically mount partitions?
a) /etc/fstab
b) /etc/mtab
c) /etc/mounts
d) /boot/fstab
Show Answer
Answer: a) /etc/fstab
Explanation: /etc/fstab (filesystem table) defines filesystems and swap devices to be mounted at boot. Each entry includes device, mount point, filesystem type, options, dump frequency, and fsck pass order. /etc/mtab shows currently mounted filesystems.
Question 43
What is a swap partition used for?
a) Storing system binaries
b) Virtual memory — extending RAM to disk
c) Temporary file storage
d) Boot loader storage
Show Answer
Answer: b) Virtual memory — extending RAM to disk
Explanation: Swap provides virtual memory by paging out less-used memory pages to disk. This allows the system to run more applications than physical RAM alone can support. Swap can be a dedicated partition or a swap file.
Question 44
Which FHS directory is reserved for variable data that is specific to a host but should persist across reboots?
a) /var/
b) /etc/
c) /tmp/
d) /run/
Show Answer
Answer: a) /var/
Explanation: /var/ contains variable data that persists across reboots (logs, databases, mail spools, print queues, temporary files kept between reboots). /var/log/ specifically contains system log files like syslog, auth.log, and kern.log.
Question 45
Which command checks and repairs an ext4 filesystem?
a) fsck.ext4 /dev/sdb1
b) e2fsck /dev/sdb1
c) fsck -t ext4 /dev/sdb1
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: fsck.ext4, e2fsck, and fsck -t ext4 all invoke the ext4 filesystem checker. The filesystem must be unmounted (or mounted read-only) before running fsck. fsck is a frontend that dispatches to filesystem-specific checkers.
Topic 105: Shell Scripting and Data Management (Questions 46–50)
Question 46
What does the #!/bin/bash line at the top of a script do?
a) Comments the file
b) Specifies the interpreter to execute the script
c) Adds debugging output
d) Defines a bash function
Show Answer
Answer: b) Specifies the interpreter to execute the script
Explanation: The shebang line (#!) tells the kernel which interpreter to use to execute the script. #!/bin/bash runs the script with the Bash shell. Common variants include #!/bin/sh, #!/usr/bin/python3, and #!/usr/bin/env bash.
Question 47
What is the purpose of $? in a bash script?
a) The process ID of the current script
b) The exit status of the last command
c) The number of command-line arguments
d) The name of the current script
Show Answer
Answer: b) The exit status of the last command
Explanation: $? holds the exit code of the most recently executed command. 0 means success, and any non-zero value indicates an error. Common special variables include $$ (PID), $# (argument count), $0 (script name), and $@ (all arguments).
Question 48
Which command is used to make a shell script executable?
a) chmod +x script.sh
b) exec script.sh
c) bash script.sh
d) source script.sh
Show Answer
Answer: a) chmod +x script.sh
Explanation: chmod +x adds execute permission to the file. After this, the script can be run as ./script.sh. bash script.sh runs it without making it executable. source script.sh runs it in the current shell environment.
Question 49
What does the continue statement do inside a loop?
a) Exits the loop immediately
b) Skips the rest of the current iteration and moves to the next
c) Restarts the loop from the beginning
d) Pauses the loop until a signal is received
Show Answer
Answer: b) Skips the rest of the current iteration and moves to the next
Explanation: continue skips the remaining code in the current loop iteration and moves to the next iteration. break exits the loop entirely. continue and break can take a numeric argument for nested loops (e.g., break 2).
Question 50
Which of the following for loops iterates over all .txt files in the current directory?
a) for file in *.txt; do echo "$file"; done
b) for file in $(ls *.txt); do echo "$file"; done
c) for file in $(find . -name "*.txt"); do echo "$file"; done
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: All three iterators will loop over .txt files, but option a) is the most efficient and safest. Options b) and c) can break with filenames containing spaces (word splitting). Shell globbing (*.txt) is the recommended approach per LPIC-1 objectives.
How Did You Score?
- 0–25 correct: Focus on your weak areas. Review the LPIC-1 101-500 Deep Dive and 102-500 Deep Dive.
- 26–40 correct: You're on the right track. A few more weeks of targeted study should get you ready.
- 41–50 correct: Ready for the exam! Try our full practice exam set for exam-like simulation.
Ready for the Full LPIC-1 Practice Exam?
These 50 questions are just a sample. Our complete LPIC-1 practice exam includes:
- 200+ questions covering all exam objectives
- Exam simulation mode with timed sessions
- Detailed analytics showing your strengths and weaknesses
- Explanations for every answer
- Progress tracking across multiple study sessions
Access all 200+ LPIC-1 practice questions →
Ready to put this knowledge to the test? Our LPI practice portal includes 200+ realistic questions covering LPIC-1, LPIC-2, LPIC-3, and DevOps Tools Engineer certifications. Study mode, timed exams, domain breakdowns, and weak-area analysis included.