Sample questions
Linux Professional Institute Certification Level 1 LPIC-1 practice questions
A system administrator needs to install a new kernel on a Debian-based system. Which TWO commands can be used to achieve this? (Choose TWO.)
Trap 1: apt-cache search linux-image-5.10.0-20-amd64
apt-cache search only searches package names and descriptions, it does not install.
Trap 2: apt-get update
apt-get update updates the package index files, it does not install packages.
Trap 3: make install
make install is used for compiling and installing software from source, not for package management.
- A
apt-cache search linux-image-5.10.0-20-amd64
Why wrong: apt-cache search only searches package names and descriptions, it does not install.
- B
apt-get update
Why wrong: apt-get update updates the package index files, it does not install packages.
- C
apt-get install linux-image-5.10.0-20-amd64
apt-get install installs packages from repositories, including kernel images.
- D
make install
Why wrong: make install is used for compiling and installing software from source, not for package management.
- E
dpkg -i linux-image-5.10.0-20-amd64.deb
dpkg -i installs a local .deb package file.
Which TWO of the following are valid methods to change the default runlevel on a SysV init-based system?
Trap 1: Use the 'runlevel' command to set the default runlevel.
The runlevel command only displays current and previous runlevels, it does not set defaults.
Trap 2: Use 'systemctl set-default' to set the default runlevel.
systemctl is used on systemd-based systems, not SysV init.
Trap 3: Use the 'telinit' command to change the default runlevel.
telinit changes the current runlevel but does not set the default for future boots.
- A
Use the 'runlevel' command to set the default runlevel.
Why wrong: The runlevel command only displays current and previous runlevels, it does not set defaults.
- B
Edit /etc/inittab to set the initdefault line.
The initdefault line in /etc/inittab defines the default runlevel.
- C
Pass the desired runlevel as a kernel parameter at boot time.
Kernel parameters like '1' or 'single' override the default runlevel for the current boot.
- D
Use 'systemctl set-default' to set the default runlevel.
Why wrong: systemctl is used on systemd-based systems, not SysV init.
- E
Use the 'telinit' command to change the default runlevel.
Why wrong: telinit changes the current runlevel but does not set the default for future boots.
A system administrator notices that a server with a freshly installed Linux system fails to boot with the error 'No bootable device found'. The server has a single SATA hard disk connected to the motherboard's SATA controller. Which of the following is the most likely cause of this issue?
Trap 1: The root filesystem is formatted with an unsupported filesystem…
An unsupported root filesystem would cause a kernel panic after the bootloader loads, not a boot device error.
Trap 2: The kernel module for the SATA controller is not included in the…
A missing kernel module would cause a kernel panic during boot, not a 'No bootable device found' error.
Trap 3: The GRUB bootloader configuration file is missing or corrupted.
GRUB issues would show a GRUB prompt or error, not a BIOS-level boot device error.
- A
The root filesystem is formatted with an unsupported filesystem type.
Why wrong: An unsupported root filesystem would cause a kernel panic after the bootloader loads, not a boot device error.
- B
The kernel module for the SATA controller is not included in the initramfs.
Why wrong: A missing kernel module would cause a kernel panic during boot, not a 'No bootable device found' error.
- C
The GRUB bootloader configuration file is missing or corrupted.
Why wrong: GRUB issues would show a GRUB prompt or error, not a BIOS-level boot device error.
- D
The BIOS boot order is set to a device that does not contain a bootable operating system.
The BIOS attempts to boot from a device that lacks a bootloader, resulting in the error.
Refer to the exhibit. A system administrator checks the integrity of the passwd package on a CentOS 7 system using rpm -V. Based on the output, what is the most likely cause of the 'missing' line?
Exhibit
Refer to the exhibit. ``` $ rpm -qf /usr/bin/passwd passwd-0.79-5.el7.x86_64 $ rpm -V passwd S.5....T. c /etc/pam.d/passwd missing c /etc/security/passwd ```
Trap 1: The package was updated to a newer version that no longer includes…
rpm -V verifies against the installed package database; if the package was updated, it would show different metadata, not 'missing'.
Trap 2: The file /etc/security/passwd was modified after installation.
Modification would show flags like S.5....T, not 'missing'.
Trap 3: The package was not installed completely.
An incomplete installation would likely show multiple missing files, not just one.
- A
The package was updated to a newer version that no longer includes this file.
Why wrong: rpm -V verifies against the installed package database; if the package was updated, it would show different metadata, not 'missing'.
- B
The file /etc/security/passwd was modified after installation.
Why wrong: Modification would show flags like S.5....T, not 'missing'.
- C
The package was not installed completely.
Why wrong: An incomplete installation would likely show multiple missing files, not just one.
- D
The file /etc/security/passwd was deleted from the filesystem.
The 'missing' attribute indicates the file is not present on disk.
Which THREE commands can be used to display the UUID of a filesystem on a Linux system without superuser privileges? (Choose three.)
Trap 1: dumpe2fs -h
dumpe2fs requires root privileges to read the superblock.
Trap 2: findfs UUID=...
findfs requires root to search for filesystems by UUID.
- A
file -s /dev/sda1
file -s reads filesystem superblock and can display UUID for some filesystems; works without root if device permissions allow.
- B
blkid
blkid can display UUIDs; though it may need root for some devices, it often works for non-root users on accessible devices.
- C
dumpe2fs -h
Why wrong: dumpe2fs requires root privileges to read the superblock.
- D
findfs UUID=...
Why wrong: findfs requires root to search for filesystems by UUID.
- E
lsblk -f
lsblk -f shows filesystem information including UUID; typically works without root.
A systems administrator needs to change the permissions of the file /home/user/script.sh so that the owner can read, write, and execute; the group can read and execute; and others have no access. Which command accomplishes this?
Trap 1: chmod 755 /home/user/script.sh
755 gives rwx for owner, r-x for group, and r-x for others, but others should have no access.
Trap 2: chmod 770 /home/user/script.sh
770 gives rwx for owner, rwx for group, and --- for others, but group has write access which is not required.
Trap 3: chmod 741 /home/user/script.sh
741 gives rwx for owner, r-- for group, and --x for others, which does not match.
- A
chmod 755 /home/user/script.sh
Why wrong: 755 gives rwx for owner, r-x for group, and r-x for others, but others should have no access.
- B
chmod 750 /home/user/script.sh
750 gives rwx for owner, r-x for group, and --- for others, matching the requirement.
- C
chmod 770 /home/user/script.sh
Why wrong: 770 gives rwx for owner, rwx for group, and --- for others, but group has write access which is not required.
- D
chmod 741 /home/user/script.sh
Why wrong: 741 gives rwx for owner, r-- for group, and --x for others, which does not match.
Which TWO commands can be used to view the contents of a compressed file named archive.tar.gz without extracting it to disk?
Trap 1: gzip -d archive.tar.gz
gzip -d decompresses, but does not list contents; it would produce archive.tar.
Trap 2: bunzip2 -c archive.tar.gz | tar -t
bunzip2 is for bzip2 compression; archive.tar.gz uses gzip.
Trap 3: gunzip -l archive.tar.gz
gunzip -l shows compression info, not the file list of the tar archive.
- A
gzip -d archive.tar.gz
Why wrong: gzip -d decompresses, but does not list contents; it would produce archive.tar.
- B
bunzip2 -c archive.tar.gz | tar -t
Why wrong: bunzip2 is for bzip2 compression; archive.tar.gz uses gzip.
- C
tar -tzf archive.tar.gz
Correct: tar -t lists table of contents; -z handles gzip; -f specifies file.
- D
gunzip -l archive.tar.gz
Why wrong: gunzip -l shows compression info, not the file list of the tar archive.
- E
zcat archive.tar.gz | tar -t
Correct: zcat decompresses to stdout; pipe to tar -t lists contents.
You are a systems administrator for a medium-sized company that runs a web server on a Linux host. The server has two physical disks: /dev/sda (250 GB) and /dev/sdb (500 GB). The root filesystem is on /dev/sda2, and /var is on /dev/sda3 (50 GB). The web application stores user-uploaded files in /var/www/uploads, which is part of the /var filesystem. Recently, /var has been running out of space because uploads have grown to 40 GB. You have added /dev/sdb1 (500 GB) and created an ext4 filesystem on it. You need to make the space available for uploads without disrupting the current file paths. The server must remain online during the process. Which of the following actions should you take?
Trap 1: Convert /var to use LVM by backing up, reformatting, and restoring…
This would require significant downtime and is more complex than necessary.
Trap 2: Create a symbolic link from /var/www/uploads to /dev/sdb1.
You cannot symlink to a block device; you need a filesystem mount. This would not work.
Trap 3: Move /var/www/uploads to /mnt/uploads and create a symbolic link…
The uploads directory is on /var which is full; moving to /mnt is okay, but the symlink doesn't free space on /var unless the data is moved off. However, the data would still physically reside on /var if moved incorrectly. The correct procedure would be to copy to new filesystem, then use bind mount.
- A
Convert /var to use LVM by backing up, reformatting, and restoring data.
Why wrong: This would require significant downtime and is more complex than necessary.
- B
Create a symbolic link from /var/www/uploads to /dev/sdb1.
Why wrong: You cannot symlink to a block device; you need a filesystem mount. This would not work.
- C
Move /var/www/uploads to /mnt/uploads and create a symbolic link from /var/www/uploads to /mnt/uploads.
Why wrong: The uploads directory is on /var which is full; moving to /mnt is okay, but the symlink doesn't free space on /var unless the data is moved off. However, the data would still physically reside on /var if moved incorrectly. The correct procedure would be to copy to new filesystem, then use bind mount.
- D
Mount /dev/sdb1 on /mnt, copy /var/www/uploads to /mnt/uploads, then mount --bind /mnt/uploads /var/www/uploads.
This moves the data to the new disk and uses a bind mount to keep the original path, preserving application access without downtime.
A system administrator notices that the /tmp directory is filling up quickly, causing applications to fail. The administrator wants to ensure that files in /tmp are automatically cleaned after a certain period. Which of the following is the best approach without installing additional software?
Trap 1: Add a cron job that runs 'rm -rf /tmp/*' every hour.
This is too aggressive and may remove files in use. Also not a standard approach without custom scripting.
Trap 2: Install tmpwatch and configure it to clean files older than 1 day.
tmpwatch is not installed by default on many distributions; the question specifies without installing additional software.
Trap 3: Set the sticky bit on /tmp to automatically delete old files.
The sticky bit prevents users from deleting files they don't own; it does not automatically clean old files.
- A
Add a cron job that runs 'rm -rf /tmp/*' every hour.
Why wrong: This is too aggressive and may remove files in use. Also not a standard approach without custom scripting.
- B
Install tmpwatch and configure it to clean files older than 1 day.
Why wrong: tmpwatch is not installed by default on many distributions; the question specifies without installing additional software.
- C
Set the sticky bit on /tmp to automatically delete old files.
Why wrong: The sticky bit prevents users from deleting files they don't own; it does not automatically clean old files.
- D
Configure the systemd-tmpfiles service with a configuration file to clean /tmp regularly.
systemd-tmpfiles is part of systemd and is available by default; it provides a clean mechanism for temporary file management.
Which TWO commands can be used to count the number of lines in a file named 'data.txt'?
Trap 1: cat data.txt | wc -c
wc -c counts characters.
Trap 2: grep -c '.*' data.txt
grep -c counts matching lines; '.*' matches all lines but if file empty, count is 0; not standard.
Trap 3: sed -n '$=' data.txt
sed -n '$=' prints line number of last line, not count (same if file non-empty but fails for empty).
- A
wc -l data.txt
wc -l counts line endings.
- B
awk 'END{print NR}' data.txt
NR holds the number of records processed.
- C
cat data.txt | wc -c
Why wrong: wc -c counts characters.
- D
grep -c '.*' data.txt
Why wrong: grep -c counts matching lines; '.*' matches all lines but if file empty, count is 0; not standard.
- E
sed -n '$=' data.txt
Why wrong: sed -n '$=' prints line number of last line, not count (same if file non-empty but fails for empty).
Refer to the exhibit. An administrator runs 'ntpq -p' and sees the output shown. What is the most likely cause of the '16' stratum and '0.000' delay/offset?
Exhibit
Refer to the exhibit.
# cat /etc/ntp.conf
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
# driftfile /var/lib/ntp/ntp.drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*0.pool.ntp.org .POOL. 16 p - 64 0 0.000 0.000 0.000
1.pool.ntp.org .POOL. 16 p - 64 0 0.000 0.000 0.000Trap 1: The NTP service is not running.
If the service were not running, ntpq -p would not return output.
Trap 2: The firewall is blocking UDP port 123.
While possible, the output shows servers are being polled (t=p), but reach is 0. More likely, NTP has just started.
Trap 3: The restrict lines are blocking all NTP queries.
The restrict lines shown do not block local queries; they restrict remote clients.
- A
The NTP service is not running.
Why wrong: If the service were not running, ntpq -p would not return output.
- B
The firewall is blocking UDP port 123.
Why wrong: While possible, the output shows servers are being polled (t=p), but reach is 0. More likely, NTP has just started.
- C
The NTP daemon has recently started and has not yet synchronized.
The 'iburst' option causes rapid initial polls, but it still takes a few minutes for synchronization. The 0 reach and stratum 16 indicate no synchronization yet.
- D
The restrict lines are blocking all NTP queries.
Why wrong: The restrict lines shown do not block local queries; they restrict remote clients.
Arrange the steps to troubleshoot a service that fails to start.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Arrange the steps to configure a static IP address on a Linux system using the command line.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Order the steps to create and apply a file system permission using ACLs.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Order the steps to add a new user to the system and grant sudo privileges.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Arrange the steps to create a LVM logical volume and mount it.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
An administrator needs to ensure that a specific kernel module is loaded automatically at boot. Which file should be used to permanently load the module?
Trap 1: /etc/modprobe.d/modules.conf
This is for modprobe options, not auto-loading.
Trap 2: /etc/sysconfig/modules
This file is not standard; some distributions use /etc/sysconfig/modules/ but not a single file.
Trap 3: /etc/conf.modules
This is an older configuration file, not commonly used.
- A
/etc/modprobe.d/modules.conf
Why wrong: This is for modprobe options, not auto-loading.
- B
/etc/sysconfig/modules
Why wrong: This file is not standard; some distributions use /etc/sysconfig/modules/ but not a single file.
- C
/etc/modules
Modules listed in /etc/modules are loaded at boot.
- D
/etc/conf.modules
Why wrong: This is an older configuration file, not commonly used.
Which TWO commands can be used to display the amount of free and used memory on a Linux system? (Select exactly 2.)
Trap 1: vmstat
vmstat reports memory, but it's less common than free.
Trap 2: du
du reports disk usage, not memory.
Trap 3: top
top shows processes and memory but is interactive; not a direct memory display command.
- A
vmstat
Why wrong: vmstat reports memory, but it's less common than free.
- B
du
Why wrong: du reports disk usage, not memory.
- C
cat /proc/meminfo
Directly reads kernel memory information.
- D
free
free displays memory usage in a concise format.
- E
top
Why wrong: top shows processes and memory but is interactive; not a direct memory display command.
A server has two disk drives: /dev/sda (SSD) and /dev/sdb (HDD). The administrator wants to place frequently accessed files on the SSD for performance. Which approach best achieves this using Linux filesystem features?
Trap 1: Configure RAID 0 across both disks to combine speed.
RAID 0 stripes data, so both disks are used equally; slow disk becomes bottleneck.
Trap 2: Use symbolic links to redirect file access to the SSD.
Symlinks are manual and not suitable for dynamic file placement.
Trap 3: Use a union mount to overlay the SSD on top of the HDD.
Union mounts are not typically used for this purpose and add complexity.
- A
Create separate LVM logical volumes on each disk and mount them at different mount points.
LVM allows flexible allocation of storage from different physical volumes.
- B
Configure RAID 0 across both disks to combine speed.
Why wrong: RAID 0 stripes data, so both disks are used equally; slow disk becomes bottleneck.
- C
Use symbolic links to redirect file access to the SSD.
Why wrong: Symlinks are manual and not suitable for dynamic file placement.
- D
Use a union mount to overlay the SSD on top of the HDD.
Why wrong: Union mounts are not typically used for this purpose and add complexity.
Refer to the exhibit. The system has a single disk with three partitions. Which partition contains the root filesystem?
Exhibit
Refer to the exhibit. $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 223.6G 0 disk ├─sda1 8:1 0 512M 0 part /boot ├─sda2 8:2 0 16G 0 part [SWAP] └─sda3 8:3 0 207.1G 0 part /
Trap 1: sda
sda is the whole disk, not a partition.
Trap 2: sda1
sda1 is mounted as /boot.
Trap 3: sda2
sda2 is swap space.
- A
sda
Why wrong: sda is the whole disk, not a partition.
- B
sda1
Why wrong: sda1 is mounted as /boot.
- C
sda2
Why wrong: sda2 is swap space.
- D
sda3
sda3 is mounted at / (root).
A server with a udev rule fails to consistently assign a persistent network interface name. What is the most likely cause?
Trap 1: The rule uses an incorrect operator.
Syntax errors would cause the rule to be ignored, not inconsistent naming.
Trap 2: The BIOS device name is configured incorrectly.
BIOS naming is separate from udev rules.
Trap 3: The kernel module for the NIC is not loaded.
If the module is not loaded, the interface wouldn't appear at all.
- A
The rule uses an incorrect operator.
Why wrong: Syntax errors would cause the rule to be ignored, not inconsistent naming.
- B
The BIOS device name is configured incorrectly.
Why wrong: BIOS naming is separate from udev rules.
- C
The kernel module for the NIC is not loaded.
Why wrong: If the module is not loaded, the interface wouldn't appear at all.
- D
The network interface's MAC address is not unique or changes.
If the MAC address changes, a rule matching by MAC will fail.
Which TWO of the following are valid methods to reduce boot time on a Linux system? (Select exactly 2.)
Trap 1: Use an initramfs with minimal drivers.
initramfs is required; minimizing it helps but not as effective as other options.
Trap 2: Increase the kernel log level to debug.
Debug logging adds overhead and increases boot time.
Trap 3: Use ext2 instead of ext4 as the root filesystem.
ext2 lacks journaling but not a significant boot time improvement.
- A
Disable unnecessary systemd services.
Reduces the number of processes started sequentially.
- B
Use an initramfs with minimal drivers.
Why wrong: initramfs is required; minimizing it helps but not as effective as other options.
- C
Replace a hard disk drive with a solid-state drive.
SSDs have much faster read speeds, reducing boot times.
- D
Increase the kernel log level to debug.
Why wrong: Debug logging adds overhead and increases boot time.
- E
Use ext2 instead of ext4 as the root filesystem.
Why wrong: ext2 lacks journaling but not a significant boot time improvement.
Which THREE of the following commands can be used to display information about block devices?
Trap 1: free
Shows memory usage.
Trap 2: ip link
Shows network interfaces.
- A
lsblk
Lists block devices.
- B
free
Why wrong: Shows memory usage.
- C
fdisk -l
Lists partition tables of block devices.
- D
blkid
Displays block device attributes.
- E
ip link
Why wrong: Shows network interfaces.
A Linux administrator is managing a server that uses RPM-based package management. They need to find which installed package provides the '/etc/ssh/sshd_config' file. Which command should they use?
Trap 1: rpm -qi /etc/ssh/sshd_config
Shows package info, but expects a package name.
Trap 2: rpm -ql /etc/ssh/sshd_config
Lists files in a package, not the package for a file.
Trap 3: rpm -qa | grep sshd_config
Lists all packages and greps, inefficient and may not work.
- A
rpm -qi /etc/ssh/sshd_config
Why wrong: Shows package info, but expects a package name.
- B
rpm -qf /etc/ssh/sshd_config
Queries the package that owns the file.
- C
rpm -ql /etc/ssh/sshd_config
Why wrong: Lists files in a package, not the package for a file.
- D
rpm -qa | grep sshd_config
Why wrong: Lists all packages and greps, inefficient and may not work.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.