CertGrid
Linux Certification

LPIC-1: Linux Administrator Practice Exam

Validates ability to perform maintenance tasks on the command line, install and configure a Linux workstation, and configure basic networking.

Start with a free LPIC-1 practice test, then work through 1,505 exam-style questions with full answer explanations, and take timed mock exams to track your readiness against the exam objectives.

1,505
Practice pool
60 qs per exam
Real exam
90 min per exam
Real exam time
Intermediate
Level
Scaled (200-800)
Passing score

CertGrid runs a fixed 60-question timed mock, separate from the real exam format above.

Objective-mapped practice, aligned to current exam objectives · Reviewed Aug 2026 · Independent practice platform.

What the LPIC-1 exam covers

Free LPIC-1 practice test questions

A sample of 10 questions with answers and explanations. Sign up free to practice all 1,505.

  1. Question 1System Architecture

    Which command is used to display messages generated by the kernel during the boot process?

    • Asyslog --kernel
    • Bbootlog
    • Cjournalctl --boot-messages
    • DdmesgCorrect
    ✓ Correct answer: D

    The kernel writes early boot and runtime messages to a fixed-size in-memory ring buffer. The dmesg command prints the contents of that kernel ring buffer, showing hardware detection, driver initialization, and other kernel-level events, which makes it the go-to tool for diagnosing boot and hardware problems.

    Why the other options are wrong
    • Asyslog --kernel is not a real command; syslog refers to the system logging service and message format, and it has no --kernel option for reading the kernel ring buffer.
    • Bbootlog is not a standard Linux command and does not exist in normal distributions.
    • Cjournalctl --boot-messages uses an invalid option; the correct journalctl flag is -b (or --boot), and even then it reads the journal rather than the raw kernel ring buffer.
  2. Question 2Linux Installation and Package Management

    What does the 'yum clean all' command do on a Red Hat-based system?

    • AClears all cached package data, headers, and metadata from the yum cacheCorrect
    • BRemoves all installed packages
    • CRemoves orphaned packages with no dependencies
    • DResets all yum repository configurations back to defaults
    ✓ Correct answer: A

    yum clean all purges the local yum cache: downloaded package files, repository metadata, and headers stored under /var/cache/yum. It is commonly run to force yum to re-download fresh metadata when repositories change or caches become stale.

    Why the other options are wrong
    • BRemoves all installed packages is wrong; yum clean all never uninstalls software, it only clears caches.
    • CRemoves orphaned packages with no dependencies describes autoremove behavior, not cache cleaning.
    • DResets all yum repository configurations to defaults is incorrect; .repo files in /etc/yum.repos.d are untouched.
  3. Question 3Shells and Shell Scripting

    Which command reads input from the user and stores it in a variable called 'name' in a bash script?

    • ACan name
    • BSet name
    • CRead nameCorrect
    • DInput name
    ✓ Correct answer: C

    The read builtin takes a line from standard input and stores it in the named variable, so the real command is 'read name', which captures the user's typed line into the variable name. With leading letters stripped, this item keys the read-based choice as its answer.

    Why the other options are wrong
    • Acan name maps to a nonexistent 'scan' command and cannot read input into a variable.
    • Bet name maps to 'set name', which manipulates shell options or positional parameters rather than reading user input.
    • Dnput name maps to a nonexistent 'input' command in Bash.
  4. Question 4Linux Installation and Package Management

    On a legacy BIOS system using GRUB2, after editing /etc/default/grub to change GRUB_TIMEOUT, which command must be run to apply the change to the bootloader?

    • Agrub-mkconfig -o /boot/grub/grub.cfgCorrect
    • Bgrub-install /dev/sda
    • Cupdate-initramfs -u
    • Dsystemctl daemon-reload
    ✓ Correct answer: A

    The file /etc/default/grub holds settings that are not used directly at boot; instead grub-mkconfig reads it together with the scripts in /etc/grub.d/ and generates the actual runtime configuration file /boot/grub/grub.cfg. Running grub-mkconfig -o /boot/grub/grub.cfg regenerates that file so the new GRUB_TIMEOUT value takes effect on the next boot. On Debian-based systems the wrapper update-grub performs the same action. Editing /etc/default/grub alone changes nothing until the config is regenerated.

    Why the other options are wrong
    • Bgrub-install /dev/sda is incorrect because that command writes GRUB's boot image and modules to the disk's boot sector and /boot, which is needed when installing or repairing the bootloader, not for applying a timeout change.
    • Cupdate-initramfs -u is incorrect because it rebuilds the initial RAM filesystem image for the kernel, which is unrelated to GRUB menu settings.
    • Dsystemctl daemon-reload is incorrect because it reloads systemd unit files at runtime and has nothing to do with the GRUB configuration on disk.
  5. Question 5Desktops, Admin Tasks, Essential Services, Networking, and Security

    Which file maps well-known service names to their port numbers and protocols, so that tools can display "http" instead of port 80?

    • A/etc/protocols
    • B/etc/servicesCorrect
    • C/etc/inetd.conf
    • D/etc/ports
    ✓ Correct answer: B

    The /etc/services file maps service names to port-number/protocol pairs, with lines such as "http 80/tcp" and "https 443/tcp". Tools like ss, netstat, and getservbyname() consult this file to translate between numeric ports and friendly service names. It is a static lookup table and does not affect which ports are actually open or listening.

    Why the other options are wrong
    • A/etc/protocols is incorrect because it maps IP protocol names (such as tcp, udp, icmp) to their protocol numbers, not service ports.
    • C/etc/inetd.conf is incorrect because it configures the legacy inetd super-server, defining which daemons handle which services, not a port-to-name table.
    • D/etc/ports is incorrect because no such standard file exists in Linux.
  6. Question 6System Architecture

    You want depmod to write its generated dependency files into an alternate root directory /mnt/sysimage (for example while repairing a system from a rescue environment) rather than the live /. Which depmod option specifies that base directory?

    • Adepmod -b /mnt/sysimage <kernelversion>Correct
    • Bdepmod -r /mnt/sysimage <kernelversion>
    • Cdepmod --chroot /mnt/sysimage <kernelversion>
    • Ddepmod -o /mnt/sysimage <kernelversion>
    ✓ Correct answer: A

    The depmod -b (or --basedir) option tells depmod to treat the given directory as the root, so it reads modules from and writes the modules.dep family of files under <basedir>/lib/modules/<kernelversion>/. This is the standard approach when generating dependency data for a system other than the running one, such as inside a mounted target during installation or rescue. Supplying the kernel version explicitly is important because the running kernel's version may differ from the target's.

    Why the other options are wrong
    • Bdepmod -r /mnt/sysimage <kernelversion> is incorrect because depmod has no -r base-root option; -r is not a depmod basedir flag.
    • Cdepmod --chroot /mnt/sysimage <kernelversion> is incorrect because depmod provides no --chroot option; the correct long form for the base directory is --basedir.
    • Ddepmod -o /mnt/sysimage <kernelversion> is incorrect because depmod has no -o output-directory option; the base path is controlled by -b.
  7. Question 7Linux Installation and Package Management

    You want to install a package from a specific repository alias only, named 'devel', even if the same package exists in other repositories on the openSUSE system. Which command targets that repository?

    • Azypper install --repo devel mypackageCorrect
    • Bzypper install --from-alias devel mypackage
    • Czypper install --only devel mypackage
    • Dzypper install mypackage@devel
    ✓ Correct answer: A

    The --repo option (-r, equivalent to --from) restricts the package selection to the repository identified by the given alias, number, or URI, so zypper installs the version from 'devel'. This is useful when the same package is published in multiple repositories with different versions. The repository's own priorities still apply for dependency resolution, but the named package itself comes from the specified repo.

    Why the other options are wrong
    • Bzypper install --from-alias devel mypackage is incorrect because the option is --from (or -r/--repo), not --from-alias.
    • Czypper install --only devel mypackage is incorrect because there is no --only option for repository selection.
    • Dzypper install mypackage@devel is incorrect because zypper does not use an @alias suffix syntax to choose a repository.
  8. Question 8GNU and Unix Commands

    In a sed substitution you want to capture the first word of each line and swap it to the end, using a backreference. Given lines like 'apple fruit', which command produces 'fruit apple'?

    • Ased 's/\(\w\+\) \(\w\+\)/\2 \1/'Correct
    • Bsed 's/(\w+) (\w+)/\2 \1/'
    • Csed 's/\(\w\+\) \(\w\+\)/$2 $1/'
    • Dsed 's/\1 \2/\2 \1/'
    ✓ Correct answer: A

    In basic regex sed, groups are delimited by escaped parentheses \( \) and the + quantifier must be escaped as \+, so \(\w\+\) captures a run of word characters into a numbered group. The replacement references the captured groups with \1 and \2, so writing them as \2 \1 outputs the second word before the first. This is the standard backreference mechanism for reordering captured text.

    Why the other options are wrong
    • Bsed 's/(\w+) (\w+)/\2 \1/' is incorrect because in BRE the unescaped parentheses and + are literal, so the pattern would try to match literal '(' and '+' characters rather than forming capture groups.
    • Csed 's/\(\w\+\) \(\w\+\)/$2 $1/' is incorrect because sed backreferences in the replacement use \1 and \2, not the shell-style $1 and $2, so '$2 $1' would be emitted literally.
    • Dsed 's/\1 \2/\2 \1/' is incorrect because \1 and \2 in the pattern (left side) refer to groups that have not yet been defined, which is a regex error rather than a way to capture words.
  9. Question 9Devices, Linux Filesystems, FHS

    On a typical FHS layout, where does the system store the runtime mail queue and pending print spool jobs that grow and shrink while services operate?

    • A/etc/spool
    • B/usr/spool
    • C/var/spoolCorrect
    • D/run/spool
    ✓ Correct answer: C

    The FHS designates /var/spool for data awaiting further processing, including the mail queue under /var/spool/mail or /var/spool/postfix and print jobs under /var/spool/cups.

    Why the other options are wrong
    • A/etc/spool is incorrect because /etc is strictly for static configuration files and contains no spool or variable data.
    • B/usr/spool is incorrect because /usr is read-only shareable data; older systems linked /usr/spool to /var/spool, but the FHS location is /var/spool. /run/spool is incorrect because /run holds volatile runtime data such as PID files and sockets that is cleared at boot, not persistent spool queues.
    • DSpool data is inherently variable, accumulating and draining as daemons accept and process work, which is why it lives under /var. This separation keeps growing runtime data off the static parts of the filesystem.
  10. Question 10Shells and Shell Scripting

    A script reads price="19.99" from a file and tries result=$((price * 2)) but bash reports a syntax error in the arithmetic expression. What is the cause and the most correct explanation?

    • ABash arithmetic expansion handles only integers, so the decimal point in 19.99 is invalidCorrect
    • BThe variable must be exported before it can be used in $(( ))
    • CYou must write result=$((\$price * 2)) with an escaped dollar sign instead
    • DArithmetic expansion requires the bc command to be installed
    ✓ Correct answer: A

    The shell's built-in arithmetic (both $(( )) and (( ))) operates strictly on integers; it has no concept of floating-point numbers, so encountering the . in 19.99 produces a syntax error. To do decimal math you must pipe the expression to an external tool such as bc or use awk/printf. This integer-only limitation is a defining characteristic of shell arithmetic.

    Why the other options are wrong
    • BThe variable must be exported before it can be used in $(( )) is incorrect because arithmetic expansion reads ordinary shell variables in the current shell regardless of export status.
    • CYou must write result=$((\$price * 2)) with an escaped dollar sign is incorrect because inside arithmetic context variables are referenced by bare name; adding or escaping a $ does not fix the decimal problem.
    • DArithmetic expansion requires the bc command to be installed is incorrect because $(( )) is a shell built-in feature that needs no external program.

Who this LPIC-1 practice exam is for

This practice set is for anyone preparing for the LPIC-1: Linux Administrator exam at the intermediate level - from first-time candidates building a foundation to experienced Linux practitioners doing a final review before test day. If you learn best by working through realistic questions and reading why each answer is right or wrong, it is built for you.

How to use this LPIC-1 practice exam

  1. Start with the free sample questions above to gauge your current baseline.
  2. Read the full explanation on every question, including why each wrong option is wrong.
  3. Track your weak domains and focus your study where you are losing the most marks.
  4. Once you are scoring consistently well, take a timed, full-length mock exam.
  5. Use your readiness score to decide when you are ready to book the real LPIC-1 exam.

Related Linux resources

LPIC-1 practice exam FAQ

How many questions are in the LPIC-1 practice exam on CertGrid?

CertGrid has 1,505 practice questions for LPIC-1: Linux Administrator, covering 6 exam domains. The LPIC-1 certification requires two exams, 101-500 and 102-500, each with 60 questions (90 minutes each), scored 200-800 with 500 to pass. CertGrid's timed mock is a fixed 60 questions.

What is the passing score for LPIC-1?

The LPIC-1 exam passing score is Scaled (200-800), and you have about 90 min per exam to complete it. CertGrid tracks your readiness against the exam objectives so you know where to focus.

Are these official LPIC-1 exam questions?

No. CertGrid is an independent practice platform. We do not provide real or leaked exam questions. Our questions are original and designed to help you practice the concepts, scenarios, and difficulty style of the LPIC-1: Linux Administrator exam.

Is there a free LPIC-1 practice test?

Yes. You can take a free LPIC-1: Linux Administrator practice test straight away: a fixed set of 20 practice questions for this exam, retryable as often as you like, with no credit card required. You get readiness scoring and a weak-domain breakdown on those questions. Paid plans unlock the full 1,505-question bank, timed mock exams and full-bank domain analytics.

What CertGrid is (and is not)

CertGrid is an independent IT certification practice platform for Azure, AWS, Google, Cisco, Security, Linux, Kubernetes, Terraform, and other certification tracks. It provides objective-mapped practice questions, readiness scoring, weak-domain drills, and explanations to help learners understand what to study next.

Independent & original. CertGrid is an independent practice platform and is not affiliated with or endorsed by Linux Professional Institute. Questions are original practice items designed to mirror certification concepts and exam style. CertGrid does not provide official exam questions or braindumps.