Unlock hundreds more features
Save your Quiz to the Dashboard
View and Export Results
Use AI to Create Quizzes and Analyse Results

Sign inSign in with Facebook
Sign inSign in with Google

Linux LPI 102 Certification Practice Quiz - Test Your Skills

Sharpen Linux Administration and Command Line Proficiency

Difficulty: Moderate
Questions: 20
Learning OutcomesStudy Material
Colorful paper art promoting a Linux LPI 102 Certification Practice Quiz

Ready to sharpen your Linux LPI 102 skills? This interactive Linux LPI 102 Certification Practice Quiz is perfect for aspiring sysadmins looking to validate their knowledge in system administration, networking, and security. With 15 multiple-choice questions designed to simulate the real exam, you can explore key concepts and identify areas for improvement. Feel free to modify any question in our editor and customize your own quizzes. For a solid foundation, try the Linux Basics Quiz or challenge yourself with the Linux System Administration Knowledge Test.

Which command includes hidden files when listing directory contents?
ls --hidden
ls -l
ls -h
ls -a
The ls -a command lists all files including hidden ones (files starting with a dot). Other options like -l show details, -h shows human-readable sizes, and --hidden is not a valid option. Thus -a is the correct flag for hidden files.
What command sets the permissions rwxr-xr-- on example.txt using numeric notation?
chmod u=rwx,g=r,o=r example.txt
chmod 644 example.txt
chmod 754 example.txt
chmod 740 example.txt
Numeric mode 754 corresponds to rwxr-xr-- (7 for owner, 5 for group, 4 for others). The other numeric values do not match the specified permission set. Using chmod 754 example.txt applies the correct bits.
Which directory contains user home directories by default on most Linux distributions?
/home
/root
/etc/home
/usr/home
/home is the standard location for user home directories across distributions. /root is the home for the root account, and /usr/home or /etc/home are not commonly used defaults. Therefore /home is correct.
Which command prints the current working directory?
pwd
cwd
dir
whereami
The pwd command stands for "print working directory" and displays the full path of the current directory. cwd and whereami are not standard commands, and dir lists files in DOS-like shells. Thus pwd is correct.
Which command displays the first ten lines of a file named logfile.txt?
more logfile.txt
tail logfile.txt
cat logfile.txt
head logfile.txt
head by default shows the first ten lines of a file. tail displays the last ten lines, cat outputs the entire file, and more paginates the output. Therefore head is the correct command.
Which file contains the definitions for persistent filesystem mounts?
/etc/fstab.conf
/etc/fstab
/proc/mounts
/etc/mtab
/etc/fstab holds the static configuration for filesystem mounts at boot or when using mount -a. /etc/mtab and /proc/mounts reflect current mounts but are not for persistent configuration. There is no standard /etc/fstab.conf.
Which command displays disk usage with human-readable sizes?
du -h
df -m
free -h
df -h
df -h shows disk filesystem usage with sizes in units like KB, MB, and GB. du -h reports directory usage, df -m shows sizes in megabytes only, and free -h reports memory usage. Thus df -h is correct.
Which command is used to create a new logical volume in LVM?
lvextend
vgcreate
lvcreate
pvcreate
lvcreate creates a new logical volume within an existing volume group. vgcreate makes a volume group, pvcreate initializes a physical volume, and lvextend grows an existing logical volume. Hence lvcreate is correct.
What is the command to restart the Apache service on a systemd-based system?
systemctl restart httpd
systemctl reload httpd
service apache2 restart
systemctl restart apache2
On many systemd-based distributions, Apache runs as httpd, so systemctl restart httpd fully stops and starts the service. service apache2 restart may not work under systemd on non-Debian systems, reload does not restart, and apache2 is not the unit name on RHEL/CentOS.
By default, which TCP port does SSH listen on?
22
21
80
23
SSH uses port 22 by default for encrypted remote logins. Port 21 is FTP, 23 is Telnet, and 80 is HTTP. Therefore 22 is correct.
In iptables, which target drops a packet without sending a response?
DROP
LOG
REJECT
ACCEPT
DROP silently discards packets without notifying the sender. REJECT sends an error response, ACCEPT allows the packet, and LOG only records it. Thus DROP is correct for silent discard.
In shell scripting, how do you assign the value 'data' to a variable named var?
var = data
$var=data
var=data
let var="data"
In shell scripts, assignments must have no spaces around the equals sign, so var=data is correct. Spaces would be parsed incorrectly, and $var=data tries to assign to the variable's value. let is for arithmetic.
Which command lists processes sorted by memory usage in descending order?
top
ps aux --sort=-%mem
htop
ps aux
ps aux --sort=-%mem sorts process output by memory usage in descending order. top and htop can also show memory usage but require interactive filtering, while ps aux alone is unsorted. Therefore the sort option is correct.
What is the purpose of the '#!' (shebang) at the beginning of a script?
It sets the script's working directory
It comments out the first line
It specifies the interpreter to execute the script
It marks the script as executable
The shebang (#!) tells the kernel which interpreter to use when running the script. It is not merely a comment, though it is ignored by the interpreter itself. It does not set execution permissions or change directories.
Which iproute2 command shows all network interfaces and their IP addresses?
netstat -i
ifconfig -a
route -n
ip addr show
ip addr show is the modern iproute2 command to list interfaces and addresses. ifconfig -a is deprecated, netstat shows statistics not detailed addresses, and route displays routing tables. Thus ip addr show is correct.
Which command would extend an LVM logical volume named lvdata by 5G and resize its ext4 filesystem in one step?
lvextend -r -L +5G /dev/vg0/lvdata
lvextend -L +5G /dev/vg0/lvdata
resize2fs -L +5G /dev/vg0/lvdata
lvresize -s 5G /dev/vg0/lvdata
The -r flag in lvextend both extends the logical volume by the specified size and grows the filesystem. Omitting -r only resizes the LV, and resize2fs alone cannot extend the LV. lvresize -s is not a valid option.
How do you create an override file for sshd.service using systemd without editing the original unit?
systemctl override sshd.service
vim /etc/systemd/system/sshd.service
systemctl daemon-reload
systemctl edit sshd.service
systemctl edit sshd.service opens or creates a drop-in override file under /etc/systemd/system, preserving the original unit. override is not a valid command, directly editing the unit risks losing changes, and daemon-reload only reloads units.
Which command recursively restores proper SELinux security contexts for files in /var/www?
semanage fcontext -R /var/www
chcon -R u:object_r:httpd_sys_content_t /var/www
setenforce 1
restorecon -R /var/www
restorecon -R resets file contexts to policies for existing files recursively. chcon changes context arbitrarily but does not restore defaults, semanage sets rules but does not apply them, and setenforce toggles enforcing mode.
Which dmesg option prints kernel messages with human-readable timestamps?
dmesg -T
dmesg -r
dmesg -n
dmesg -H
The -T flag in dmesg translates the kernel's internal timestamps to real-world time. -r shows raw timestamps, -n sets the logging level, and -H provides highlighting support, not timestamps.
Which Linux bonding mode number corresponds to active-backup failover?
0
1
2
4
Mode 1 in the Linux bonding driver provides active-backup (failover) functionality. Mode 0 is round-robin, 2 is balance-xor, and 4 is IEEE 802.3ad (LACP). Therefore mode 1 is correct.
0
{"name":"Which command includes hidden files when listing directory contents?", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Which command includes hidden files when listing directory contents?, What command sets the permissions rwxr-xr-- on example.txt using numeric notation?, Which directory contains user home directories by default on most Linux distributions?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}

Learning Outcomes

  1. Analyse exam-style scenarios to gauge Linux system proficiency.
  2. Evaluate file system and device management techniques effectively.
  3. Master networking and service configuration principles confidently.
  4. Identify security and user permission best practices.
  5. Demonstrate shell scripting and automation understanding.
  6. Apply process management and troubleshooting strategies.

Cheat Sheet

  1. Master the Linux Filesystem - Get acquainted with the Linux directory tree so you always know where to find or place files. From /etc (your configuration HQ) to /var (the bustling hub of logs and spooled data), you'll navigate like a seasoned explorer. Dive into Exam Objectives
  2. User & Group Management - Learn to create and modify user accounts with commands like useradd and usermod, and keep your system secure by organizing users into groups. It's like assembling your personal team of digital collaborators with custom permissions! Check Exam Objectives
  3. File Permissions & Ownership - Practice setting read, write, and execute bits with chmod and assign ownership using chown. This ensures only the right users can peek, edit, or run your files - think of it as handing out VIP passes! See Exam Objectives
  4. Task Scheduling with cron & at - Automate recurring chores using cron for regular tasks and at for one-shot jobs. Whether it's nightly backups or a one-time cleanup, you'll free up brainpower for more exciting challenges. Explore Exam Objectives
  5. Shell Scripting Basics - Start writing simple scripts that loop through tasks and make conditional decisions. Soon you'll transform repetitive commands into single-shot scripts - your future self will thank you! View Exam Objectives
  6. Network Configuration Files - Peek under the hood of network settings by mastering /etc/hosts and /etc/resolv.conf. Understanding these files is like having a backstage pass to troubleshoot and optimize connectivity. Read Exam Objectives
  7. Configuring iptables Firewall - Build your own defense wall by crafting rules that allow or block traffic with iptables. You'll control incoming and outgoing data streams like a digital bouncer at the club entrance. Check Out Exam Objectives
  8. Text Processing Tools - Become a text ninja with grep, sed, and awk. Search, filter, and transform data in seconds - think of these tools as your Swiss Army knife for all things text. Explore Exam Objectives
  9. Process Management - Keep an eye on running programs with ps and top, and learn to terminate misbehaving tasks using kill. It's like being an air traffic controller for your system's processes! See Exam Objectives
  10. Bootloader Configuration - Dive into GRUB settings to ensure your system boots smoothly and recover quickly from startup hiccups. You'll gain the power to select kernels, tweak boot parameters, and rescue stalled systems. View Exam Objectives
Powered by: Quiz Maker