What the LPIC-1 exam covers
- System Architecture168 questions
- Linux Installation and Package Management141 questions
- GNU and Unix Commands143 questions
- Devices, Linux Filesystems, FHS142 questions
- Shells and Shell Scripting139 questions
- Desktops, Admin Tasks, Essential Services, Networking, and Security115 questions
Free LPIC-1 practice test questions
A sample of 10 questions with answers and explanations. A free account includes a fixed set of 20 practice questions for this exam, retryable anytime. Paid access unlocks the full 848-question bank.
-
Which command is used to display messages generated by the kernel during the boot process?
- Asyslog --kernel
- Bbootlog
- Cjournalctl --boot-messages
- DdmesgCorrect
✓ Correct answer: DThe 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.
-
Which command sorts the contents of a file in reverse numerical order?
- Asort -rn fileCorrect
- Bsort -d file
- Csort --reverse file
- Dsort -ar file
✓ Correct answer: Asort orders lines, -n forces numeric comparison instead of lexicographic, and -r reverses the result, so sort -rn produces a descending numeric sort. Combining the two flags is the standard way to list numeric values from largest to smallest.
Why the other options are wrong- Bsort -d file uses dictionary (alphanumeric) order and does not sort numerically or in reverse.
- Csort --reverse file reverses order but lacks -n, so it sorts as text rather than by numeric value.
- Dsort -ar file uses an invalid -a flag and does not perform a reverse numeric sort.
-
Which environment variable must be set on a remote machine so that an X11 application renders its GUI window on the local X server?
- ADESKTOP_SESSION
- BDISPLAYCorrect
- CTERM
- DXAUTHORITY
✓ Correct answer: BAn X11 client decides where to draw its window by reading the DISPLAY environment variable, formatted as host:displaynumber.screen. Setting DISPLAY on the remote machine to point at the local X server (or letting ssh -X set it to a localhost forwarding socket) directs the GUI output to the intended X server.
Why the other options are wrong- ADESKTOP_SESSION is wrong because it merely names the active desktop environment, not the X server target.
- CTERM is wrong because it describes the terminal type for text-mode programs, unrelated to X11 display targeting.
- DXAUTHORITY points to the file holding X authentication cookies; it controls access permission, not which display the application connects to.
-
A junior admin reduced the superuser-reserved block percentage on a large data volume from the default 5% to 1% to reclaim space. Which command did they use on /dev/sdb1?
- Atune2fs -m 1 /dev/sdb1Correct
- Btune2fs -r 1 /dev/sdb1
- Cresize2fs -M 1 /dev/sdb1
- De2fsck -p 1 /dev/sdb1
✓ Correct answer: AThe -m option of tune2fs sets the percentage of filesystem blocks reserved for the superuser (and processes running as root), and lowering it from 5 to 1 frees a meaningful amount of space on a large volume. The reservation exists so root and critical daemons can still write when the filesystem is otherwise full, so on non-root data volumes a small or zero reservation is often acceptable. You may alternatively use -r to set the reserved count in absolute blocks.
Why the other options are wrong- Btune2fs -r 1 /dev/sdb1 is incorrect because -r sets the reserved block count as an absolute number of blocks, so -r 1 would reserve a single block rather than a percentage.
- Cresize2fs -M 1 /dev/sdb1 is incorrect because resize2fs changes filesystem size and -M shrinks it to the minimum; it cannot adjust the reserved percentage.
- De2fsck -p 1 /dev/sdb1 is incorrect because e2fsck -p runs an automatic preen-mode check and takes no percentage argument.
-
An administrator types 'shutdown -h +5' and then realizes the timing is wrong. Which command cancels the pending shutdown before it executes?
- Ashutdown -cCorrect
- Bshutdown -k
- Cshutdown -a
- Dshutdown --stop
✓ Correct answer: AThe -c option cancels a shutdown that was scheduled with a future time argument such as '+5'. While the shutdown is pending, init/systemd holds the request and -c aborts it; an optional message after -c is broadcast to logged-in users explaining the cancellation. This works only while a timed shutdown is still in its waiting period.
Why the other options are wrong- Bshutdown -k is incorrect because -k only sends the warning wall message to users without actually scheduling or stopping a shutdown.
- Cshutdown -a is incorrect because under sysvinit-style shutdown -a uses /etc/shutdown.allow for access control, not cancellation.
- Dshutdown --stop is incorrect because there is no --stop option to shutdown; cancellation is done with -c.
-
An administrator wants to use aptitude from the command line to update the package lists and then upgrade all installed packages, mirroring 'apt-get update' followed by 'apt-get dist-upgrade'. Which aptitude command performs the distribution upgrade step?
- Aaptitude full-upgradeCorrect
- Baptitude dist-upgrade-now
- Captitude upgrade --dist
- Daptitude grand-upgrade
✓ Correct answer: AIn aptitude's command-line mode, 'aptitude full-upgrade' is the equivalent of apt-get dist-upgrade: it upgrades installed packages and may install or remove packages as needed to satisfy changed dependencies. The plain 'aptitude safe-upgrade' is the conservative variant that avoids removing packages. The list-refresh step is performed separately with 'aptitude update'.
Why the other options are wrong- Baptitude dist-upgrade-now is incorrect because there is no dist-upgrade-now action; aptitude uses full-upgrade (older versions also accepted dist-upgrade).
- Captitude upgrade --dist is incorrect because aptitude has no 'upgrade' action with a --dist flag.
- Daptitude grand-upgrade is incorrect because grand-upgrade is not an aptitude command.
-
You want xargs to insert each input filename at a specific position in the command, for example running 'cp FILE /backup/' for every file listed on stdin. Which xargs option provides this placeholder substitution?
- Axargs -I {} cp {} /backup/Correct
- Bxargs -n {} cp {} /backup/
- Cxargs -p {} cp {} /backup/
- Dxargs -t {} cp {} /backup/
✓ Correct answer: AThe -I option defines a replacement string (here {}) that xargs substitutes with each input item, and it implicitly runs the command once per input line. This lets the filename appear anywhere in the command, such as before the destination directory, rather than only being appended at the end. It is the standard mechanism for placing arguments at arbitrary positions.
Why the other options are wrong- Bxargs -n {} cp {} /backup/ is incorrect because -n expects a numeric maximum-arguments value, not a replacement string, so {} is an invalid argument.
- Cxargs -p {} cp {} /backup/ is incorrect because -p enables interactive prompting before each command and takes no replacement string.
- Dxargs -t {} cp {} /backup/ is incorrect because -t merely echoes each command to stderr before running it and does not define a placeholder.
-
In the editor opened by edquota, a user's line shows four numeric columns after the filesystem and 'blocks' value. What do the columns labeled soft and hard under 'blocks' represent?
- AThe block usage limits, where soft may be exceeded temporarily during the grace period and hard can never be exceededCorrect
- BThe count of inodes currently reserved for the user, showing how many files and directories they may still create
- CThe percentage of the whole filesystem the user is allowed to consume, split into a warning level and a hard ceiling
- DThe soft and hard limits expressed in fixed megabytes, applied identically no matter what block size the filesystem uses
✓ Correct answer: AIn edquota output the block section lists the current usage followed by a soft limit and a hard limit, both expressed in filesystem blocks (typically 1 KiB units for the quota tools). The soft limit may be exceeded for the duration of the grace period, after which it becomes enforced like a hard limit, while the hard limit can never be crossed even momentarily. Setting a value to 0 in either column disables that particular limit. This block/inode soft-and-hard structure is the core of how Linux quotas constrain usage.
Why the other options are wrong- BThe count of inodes reserved is incorrect because inode limits appear in a separate inode section, not the block soft/hard columns.
- CThe percentage of the filesystem is incorrect because quota limits are absolute block and inode counts, not percentages.
- DLimits in fixed megabytes is incorrect because the edquota block values are counted in blocks (commonly 1 KiB), not fixed megabytes.
-
A script needs to confirm that the variable $PORT contains a value AND that the value is numerically within the range 1 to 65535. Which TWO approaches correctly express the combined requirement? (Choose TWO)
- A[ -n "$PORT" ] && [ "$PORT" -ge 1 ] && [ "$PORT" -le 65535 ]Correct
- B[[ -n $PORT && $PORT -ge 1 && $PORT -le 65535 ]]Correct
- C[ -n "$PORT" -a "$PORT" => 1 -a "$PORT" =< 65535 ]
- D[[ $PORT -gt 0 || $PORT -lt 65536 ]]
✓ Correct answer: A, BBoth correct options combine a non-empty string check (-n) with the numeric range tests -ge 1 and -le 65535, requiring all three to be true. The first chains three separate test commands with the shell && operator; the second uses the && logical AND inside one [[ ]] conditional, which also permits the numeric operators -ge and -le. Each enforces that $PORT is set and falls within the valid port range.
Why the other options are wrong- C[ -n "$PORT" -a "$PORT" => 1 -a "$PORT" =< 65535 ] is incorrect because => and =< are not valid operators; numeric comparisons require -ge and -le, and the test would produce a syntax error.
- D[[ $PORT -gt 0 || $PORT -lt 65536 ]] is incorrect because the || makes it an OR, so almost any number satisfies one half of the condition, and it omits the non-empty check entirely, so it does not enforce the range.
-
A command queued with at produces some output on standard output. The user did not redirect that output anywhere. By default, what does atd do with the job's standard output and standard error?
- AIt emails the output to the user who owns the job using the local mail systemCorrect
- BIt writes the output to /var/log/atd.log
- CIt discards the output silently
- DIt appends the output to the user's ~/.at_output file instead
✓ Correct answer: AWhen an at job generates output that is not explicitly redirected, the atd daemon sends that combined standard output and standard error to the job owner via the local mail transfer agent, just as cron does for cron jobs. This is why a working local MTA (such as Postfix or sendmail) is often required to receive notifications from scheduled jobs. If the user wants no mail, they must redirect the command's output within the job.
Why the other options are wrong- BIt writes the output to /var/log/atd.log is incorrect because atd does not maintain a per-output log file; it mails output to the owner.
- CIt discards the output silently is incorrect because output is captured and mailed unless the user redirects it away.
- DIt appends the output to the user's ~/.at_output file is incorrect because no such file is used by at.
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
- Start with the free sample questions above to gauge your current baseline.
- Read the full explanation on every question, including why each wrong option is wrong.
- Track your weak domains and focus your study where you are losing the most marks.
- Once you are scoring consistently well, take a timed, full-length mock exam.
- Use your readiness score to decide when you are ready to book the real LPIC-1 exam.
Related Linux resources
- LPIC-1 study guideKey concepts
- Linux practice examsAll Linux
- Certification pathWhere this fits
- Certification exam guides & tipsBlog
- Plans & pricingFree & paid
- Hands-on lpic-1 labsLearn
- Hands-on lpic-2 labsLearn
- LPIC-1 command cheat sheetCheat sheet
- LPIC-2 command cheat sheetCheat sheet
- How these questions are written and reviewedMethodology
- Report a problem with a questionCorrections
- LPIC-2 practice examRelated
- Red Hat Certified Ansible (EX294-style) practice examRelated
- Red Hat Certified System Administrator (RHCSA, EX200-style) practice examRelated
LPIC-1 practice exam FAQ
How many questions are in the LPIC-1 practice exam on CertGrid?
CertGrid has 848 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 848-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.