IT Certifications

CompTIA Linux+ Certification Exam Practice Test

Linux system administration centers on managing files, users, processes, services, storage, and network settings from the command line. Practice scenarios cover tasks such as checking disk usage, setting file ownership, extracting archives, inspecting systemd services, following logs, and identifying interface addresses. These skills support routine configuration and troubleshooting on Linux hosts.

Exam overview

Exam providerCompTIA
Exam codeNot listed
CategoryIT Certifications

About the CompTIA Linux+ Certification Exam

Effective administration requires choosing commands that reveal the right system state and applying changes with appropriate scope. File tasks include creating directories, managing ownership and permissions, and using shell redirection without overwriting existing data. Storage work involves interpreting human-readable directory sizes and handling compressed tar archives. For service troubleshooting, administrators inspect systemd status and recent failure details, then correlate those findings with application logs. Network configuration calls for distinguishing interface addresses, DHCP-provided settings, and resolver configuration, including the role of `/etc/resolv.conf` in specifying DNS nameservers. Understanding command output and configuration files helps narrow faults before making changes, while attention to paths, options, and privileges reduces operational mistakes.

Sample Practice Questions

Review a selection from this exam's published US Practice Tests practice bank.

Question 1

A Linux system must resolve hostnames using a DNS server, but its configured resolver settings may direct queries elsewhere. Which file commonly specifies resolver nameserver addresses?

  1. A/etc/resolv.conf
  2. B/etc/hostname
  3. C/etc/passwd
  4. D/etc/fstab
Show answerCorrect answer: A

`/etc/resolv.conf` commonly contains resolver configuration such as `nameserver` entries. On some systems it is generated or managed by another network service, so direct edits may not persist.

Question 2

An administrator wants to see the amount of space used by each immediate subdirectory of `/var/cache`, with sizes displayed in human-readable units. Which command is appropriate?

  1. Adu -h --max-depth=1 /var/cache
  2. Bdf -h --max-depth=1 /var/cache
  3. Cls -lh --max-depth=1 /var/cache
  4. Dfree -h /var/cache
Show answerCorrect answer: A

`du` reports disk usage for files and directories; `--max-depth=1` limits the report to the target and its immediate children. `df` reports filesystem capacity, `ls` lists directory entries, and `free` reports memory usage.

Question 3

A Linux host is configured to obtain an IPv4 address and network settings automatically from a DHCP server. What information does DHCP commonly provide in addition to the address?

  1. AA subnet mask and default gateway
  2. BA user's login password and shell
  3. CThe contents of the system's package database
  4. DThe filesystem UUIDs for local disks
Show answerCorrect answer: A

DHCP commonly supplies network configuration such as an IP address, subnet mask or prefix, default gateway, and DNS server information. It does not provide local account credentials, package data, or disk identifiers.

Question 4

A user needs to unpack a gzip-compressed tar archive named `logs.tar.gz` into the current directory. Which command is appropriate?

  1. Atar -xzf logs.tar.gz
  2. Btar -czf logs.tar.gz
  3. Cgzip -d logs.tar.gz
  4. Dzip -r logs.tar.gz
Show answerCorrect answer: A

The tar options `-x` extract, `-z` handle gzip compression, and `-f` specify the archive file. Option B creates an archive, while gzip alone decompresses the stream without extracting the tar members.

Question 5

A systemd-managed service is failing to start, and an administrator wants a concise summary of its current state and recent failure information. Which command is appropriate?

  1. Asystemctl status example.service
  2. Bsystemctl daemon-reload example.service
  3. Csystemctl list-dependencies example.service
  4. Dsystemctl preset example.service
Show answerCorrect answer: A

systemctl status displays a unit's state and typically includes recent log lines and details useful for initial troubleshooting. The other commands reload unit definitions, show dependency relationships, or apply preset policies.

Question 6

Which command creates a new directory named `archive` inside the current directory?

  1. A`touch archive`
  2. B`mkdir archive`
  3. C`rmdir archive`
  4. D`ln archive`
Show answerCorrect answer: B

`mkdir` creates directories. `touch` creates or updates a file, `rmdir` removes an empty directory, and `ln` creates links.

Question 7

Which command changes the owner of `report.txt` to user `alex`?

  1. A`chmod alex report.txt`
  2. B`chown alex report.txt`
  3. C`chgrp alex report.txt`
  4. D`umask alex report.txt`
Show answerCorrect answer: B

`chown` changes file ownership. `chmod` changes permission bits, `chgrp` changes the group, and `umask` controls default permissions for newly created files.

How to use this practice test

Access the Linux+ practice questions for free. Each session presents up to 20 random questions from the available bank, with results shown after the session. Use missed items to identify command syntax or system concepts to revisit, such as resolver configuration, service status, file ownership, or log monitoring.

Preparation tips

  • Practice `du` options for summarizing immediate subdirectories and displaying sizes in human-readable units.
  • Compare `systemctl status` output with `journalctl` entries when investigating a service that fails to start.
  • Review ownership and permission commands, including how `chown` targets users and how redirection operators affect existing files.
  • Work through archive and log tasks using `tar` extraction options and `tail -f` for following new entries.
  • Trace basic host networking by checking interface addresses, DHCP-provided settings, and nameserver entries in `/etc/resolv.conf`.
Official sourceOfficial exam page ↗