CompTIA Linux+ Practice Test

CompTIA Linux+ Practice Test 1

CompTIA Linux+ Exam

1 / 80

What does the iptables -A INPUT -p tcp --dport 22 -j ACCEPT command do?

2 / 80

Which command creates a new user account named "jdoe" with a home directory?

3 / 80

What is the purpose of the /etc/fstab file?

4 / 80

Which command displays real-time CPU and memory usage for running processes?

5 / 80

What does the grep -r "error" /var/log command do?

6 / 80

Which utility is used to manage software packages on a Red Hat-based system?

7 / 80

What command schedules a one-time task to run at 2:00 AM tomorrow?

8 / 80

Which file is used to configure persistent network interface settings on a Debian-based system?

9 / 80

What is the purpose of the chmod 755 command on a file?

 

10 / 80

Which command displays the current running kernel version on a Linux system?

11 / 80

A system is experiencing repeated unauthorized login attempts. What combination of Linux tools/configurations helps mitigate this?

12 / 80

A service using systemd is not starting automatically after boot. Which command can you use to enable it so it starts on boot?

13 / 80

Which of the following tasks is MOST appropriate to include in a shell script intended for system maintenance automation?

14 / 80

You suspect a user account was compromised because unauthorized processes are running under that user. Which file helps review recent login and session activity?

15 / 80

A containerized application fails because a required shared library is missing inside the container. What is the likely cause?

16 / 80

You want to enforce minimum password complexity and aging policies for all users. Which configuration file is typically modified on a Linux system to set such policies?

17 / 80

Which command would you use to identify network interfaces and check their status on a modern Linux system?

18 / 80

During boot, a system fails to find root filesystem and drops to emergency shell. What is a plausible cause?

19 / 80

Which Linux permission bit combination allows a directory where users can create files but cannot delete or rename files owned by others?

20 / 80

A production server suddenly slows down and shows high I/O wait times. What is a valid first diagnostic step?

21 / 80

You’ve installed a new package using the system’s package manager. Which of the following ensures all dependencies are satisfied and package metadata is updated properly?

22 / 80

A shell script must run every day at 2:15 AM. Which tool should be used to schedule it on a typical Linux server?

23 / 80

Which command shows currently loaded kernel modules and can be used to verify module dependencies or troubleshoot hardware support?

24 / 80

You need to allow only SSH access from a specific subnet (e.g., 192.168.1.0/24) while dropping other SSH attempts. Which tool and configuration approach aligns with Linux+ security objectives?

25 / 80

A user complains that they cannot execute a script because “Permission denied” appears, even though the file permissions are rwxr-xr-x. What is the MOST likely cause on a modern Linux system?

26 / 80

Which of these directories is defined by the Filesystem Hierarchy Standard (FHS) to store device files for block and character devices?

27 / 80

On a system using LVM, you notice the logical volume for /var is almost full. You have free space in the volume group. Which command achieves safe expansion of /var without data loss?

28 / 80

You need to create a backup of a directory /home/data preserving permissions, ownership, hard links, and ensure high compression. Which command is most appropriate?

29 / 80

Which command sequence would you use to view detailed hardware information of PCI devices on a Linux system?

30 / 80

When a Linux system fails to boot and displays a “kernel panic” during initialization, which file or process is MOST likely involved in the problem?

31 / 80

In a scenario where /var/log fills up rapidly due to excessive logging, what is a recommended mitigation?

32 / 80

A server’s network interface fails to obtain an IP via DHCP after reboot, but the cable and switch are known-good. What is a likely troubleshooting step?

33 / 80

You want to monitor real-time CPU and memory usage trends over time and store historical data for analysis. Which tool or approach fits best?

34 / 80

A user’s group membership was changed, but the user still lacks the new permissions until after logging out and back in. Why?

35 / 80

You attempt to compile software from source (./configure → make → make install), but after a kernel update the module fails to load. What might you need to do first?

36 / 80

A Linux server’s time is drifting; logs show strange timestamps. Which service should you configure to ensure accurate system time automatically?

37 / 80

You want to share a folder /srv/share between multiple Linux machines over the network. Which tools and configuration are most appropriate?

38 / 80

Which command shows both mounted filesystems and block device usage, helping identify storage issues quickly?

39 / 80

A container image must include a required library under /usr/lib. Which Dockerfile directive ensures the directory and library are copied at build time?

40 / 80

Which command lets you search for files by name recursively under /etc, even if filenames contain spaces, and list their full paths?

41 / 80

You must compile a kernel module for a custom driver on your Linux system. What files or packages should be present before compiling?

42 / 80

Which of the following ensures that critical logs are preserved across reboots, even if the system crashes?

43 / 80

A cron job produces output you don’t want mailed to the user. How do you disable mail output for that job?

44 / 80

You want to restrict a user so they can only read a directory but neither modify nor list its contents, yet still allow them to enter the directory if they know a file name inside. Which permission scheme works?

45 / 80

Which command would you use to view system log entries (e.g., boot messages, service errors) to diagnose a failing service?

46 / 80

Which command will show memory usage, number of running processes, load average, and uptime in one glance?

47 / 80

A user reports that after changing /etc/fstab, the system drops to emergency shell on reboot. What should you check first?

48 / 80

You must schedule a one-time maintenance task for midnight tonight. Which command should you use?

49 / 80

A large file needs to be transferred across the network secure and reliably. Which command provides encryption, progress feedback and resume capability?

50 / 80

Which command compresses a directory and creates a gzipped archive, preserving all file metadata and symbolic links?

51 / 80

Which command displays running systemd units?

52 / 80

A user’s disk quota is ignored. What must be enabled on filesystem?

53 / 80

Which tool changes SELinux mode temporarily until reboot?

54 / 80

Storage team expands LVM PV size. What must be done to use new space?

55 / 80

FirewallD service should allow HTTP inbound traffic permanently. Which command works?

56 / 80

Your server boots into emergency mode due to corrupted boot loader. First recovery step?

57 / 80

Which command shows block device layout including partitions?

58 / 80

A user needs persistent environment variables across sessions. Where should they be placed?

59 / 80

To compress a directory into a tar.gz file, what is the correct command?

60 / 80

A user forgot their password. Root access is available. How do you reset it?

61 / 80

Which command displays disk usage of directories?

62 / 80

To schedule a one-time maintenance task for 3AM tomorrow, what should you use?

63 / 80

A server requires an encrypted remote shell session. Which protocol should be used?

64 / 80

You need to determine which process is consuming high CPU. What command is best?

65 / 80

A filesystem reports 95% inode usage even though disk space is free. What is the correct action?

66 / 80

You need to identify failed login attempts for security auditing. Which log should be inspected on most Linux systems?

67 / 80

A script returns Permission denied despite correct ownership. What is the likely fix?

68 / 80

You need to check open ports and listening daemons to verify firewall configuration. Which tool is most appropriate?

69 / 80

A server should automatically restart an Apache service if it stops unexpectedly. What is the best solution?

70 / 80

A junior admin accidentally removed /etc/fstab entries and the system fails to mount filesystems at boot. What is the fastest recovery approach?

71 / 80

Kernel module insertion fails after update. You need to see why. What command exposes this?

72 / 80

SSH brute-force attempts rapidly increase. What is the most effective immediate defense?

73 / 80

A script prints no visible output, but silently fails. You need stdout & stderr together for debugging. What do you use?

74 / 80

You created a new LUKS encrypted partition. Before mounting it, you must:

75 / 80

A server shows "disk full" despite several GB free. What should be checked?

76 / 80

A user cannot write to an NFS mount despite permission bits appearing correct. What is the most likely cause?

77 / 80

Only the system's local DNS resolver should be able to perform outbound DNS requests. How should this be enforced?

78 / 80

Your backup server must remain online during power loss until UPS battery is nearly depleted. What ensures this?

79 / 80

A developer running ./configure receives the output command not found. What is missing?

80 / 80

A systemd service works when manually started but does not start automatically after reboot. What should be done?

Your score is

The average score is 70%

0%