Docsity

CompTIA Linux+ Exam Practice Questions, Exams of Networking

Toggle sidebar
bg1
CompTIA Linux+ Exam
Question 1. Which command displays the current runlevel of a Linux
system?
A) runlevel
B) level
C) systemctl status
D) reboot
Answer: A
Explanation: The runlevel command shows the current and previous
runlevels of the system, which are used to define system states in
traditional SysV init systems.
Question 2. What is the primary function of the Linux kernel?
A) Managing user accounts
B) Handling hardware and system resources
C) Providing a graphical user interface
D) Compiling software
Answer: B
Explanation: The Linux kernel is responsible for managing hardware
resources and providing essential services to the system and
applications.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download CompTIA Linux+ Exam Practice Questions and more Exams Networking in PDF only on Docsity!

Question 1. Which command displays the current runlevel of a Linux system? A) runlevel B) level C) systemctl status D) reboot Answer: A Explanation: The runlevel command shows the current and previous runlevels of the system, which are used to define system states in traditional SysV init systems. Question 2. What is the primary function of the Linux kernel? A) Managing user accounts B) Handling hardware and system resources C) Providing a graphical user interface D) Compiling software Answer: B Explanation: The Linux kernel is responsible for managing hardware resources and providing essential services to the system and applications.

Question 3. Which command is used to list all files, including hidden ones, in a directory? A) ls B) ls - a C) list - h D) showfiles Answer: B Explanation: The ls - a command lists all files in a directory, including those that start with a dot, which are hidden by default. Question 4. What does the chmod 755 filename command do? A) Grants read, write, and execute to everyone B) Sets owner to full access, group and others to read and execute C) Removes write permissions for the owner D) Sets all permissions to none Answer: B Explanation: chmod 755 means owner gets full (rwx), while group and others get read and execute (r-x).

Question 7. What is the purpose of the sticky bit on a directory? A) Allows only the owner to delete or rename files within the directory B) Grants execute permission to all users C) Prevents any changes to files D) Hides files from users Answer: A Explanation: The sticky bit ensures that only file owners (or root) can delete or rename files in the directory, commonly used on /tmp. Question 8. Which command is used to display running processes? A) top B) grep C) df D) chmod Answer: A Explanation: The top command displays running processes and system resource usage in real time. Question 9. What file system is known for supporting journaling and large volumes on Linux?

A) ext B) ext C) FAT D) NTFS Answer: B Explanation: ext4 is a widely used Linux file system that supports journaling and large volume sizes. Question 10. Which tool is used to manage Logical Volume Manager (LVM) physical volumes? A) pvcreate B) lvcreate C) vgcreate D) mkfs Answer: A Explanation: pvcreate initializes a physical disk or partition for use by LVM as a physical volume. Question 11. Which command shows information about mounted file systems?

B) RAID 1

C) RAID 5

D) RAID 2

Answer: C Explanation: RAID 5 stripes data across disks with parity, offering both redundancy and improved read performance. Question 14. What is the default text editor for many Linux distributions? A) nano B) vim C) emacs D) gedit Answer: B Explanation: vim is the default text editor in many Linux distributions, especially on servers. Question 15. Which command is used to change the owner of a file? A) chmod B) chown

C) chgrp D) touch Answer: B Explanation: chown changes the owner (and optionally the group) of a file or directory. Question 16. What is the purpose of the /etc/fstab file? A) Stores user passwords B) Lists mounted file systems and their mount options C) Records system logs D) Manages network interfaces Answer: B Explanation: /etc/fstab contains static information about filesystems and their mount points and options. Question 17. Which command is used to monitor real-time logs from systemdโ€™s journal? A) dmesg B) journalctl - f C) tail - f /var/log/syslog

Answer: A Explanation: shutdown - h now initiates an immediate shutdown and halts the system. Question 20. What does the command ln - s /etc/nginx/nginx.conf /tmp/nginx.conf create? A) A hard link B) A symbolic link C) A backup copy D) A new file Answer: B Explanation: ln - s creates a symbolic (soft) link, in this case pointing /tmp/nginx.conf to /etc/nginx/nginx.conf. Question 21. Which of the following commands is used to display disk usage statistics of directories and files? A) du B) df C) ls D) stat

Answer: A Explanation: du (disk usage) summarizes disk usage for files and directories. Question 22. How can you recursively copy a directory and its contents? A) cp dir1 dir B) cp - r dir1 dir C) mv dir1 dir D) copy dir1 dir Answer: B Explanation: cp - r copies directories and their contents recursively. Question 23. Which command is used to search for a string within files? A) find B) grep C) awk D) sed Answer: B

Question 26. Which command displays all network interfaces and their status? A) ip link B) ifconfig C) netstat D) showif Answer: A Explanation: ip link shows all network interfaces and their states; ifconfig is deprecated in many systems. Question 27. How do you display routing table information? A) route B) ip route C) netstat - r D) All of the above Answer: D Explanation: All provided commands can display routing table information, though ip route is the modern replacement.

Question 28. Which file contains the static IP configuration for a network interface on most modern Linux systems? A) /etc/network/interfaces B) /etc/sysconfig/network-scripts/ifcfg-eth C) /etc/netplan/*.yaml D) All of the above Answer: D Explanation: Different distributions use different files for static IP configuration; all listed are valid in certain distros. Question 29. What is the function of DNS? A) Translate IP addresses to MAC addresses B) Convert hostnames to IP addresses C) Assign IP addresses automatically D) Secure network traffic Answer: B Explanation: DNS (Domain Name System) translates human-readable hostnames into IP addresses. Question 30. How do you check if a remote host is reachable?

B) scp C) ftp D) rsync Answer: B Explanation: scp (secure copy) is used to securely transfer files between hosts over SSH. Question 33. What is the primary function of rsync? A) Synchronize files/directories locally or remotely B) Compress files C) Encrypt network traffic D) Manage disk quotas Answer: A Explanation: rsync is a versatile tool for synchronizing files and directories locally or remotely. Question 34. Which package manager is used by Ubuntu and Debian systems? A) yum B) dnf

C) apt D) zypper Answer: C Explanation: apt is the package manager for Debian, Ubuntu, and related distributions. Question 35. What does the command apt update do? A) Installs new software B) Updates package lists from repositories C) Upgrades all installed packages D) Removes unused packages Answer: B Explanation: apt update refreshes the package index to know about the latest available packages. Question 36. Which command upgrades all installed packages on a Debian-based system? A) apt-get update B) apt upgrade C) apt remove

D) dnf packages Answer: B Explanation: dnf list installed lists all installed packages on Fedora, RHEL, and CentOS systems using DNF. Question 39. What is the purpose of compiling software from source? A) To remove software B) To customize and optimize software for your system C) To download prebuilt binaries D) To update the kernel automatically Answer: B Explanation: Compiling from source allows customization and optimization for specific system requirements. Question 40. Which file stores local user account information? A) /etc/shadow B) /etc/passwd C) /etc/sudoers D) /etc/group

Answer: B Explanation: /etc/passwd contains basic user account information such as username, UID, GID, home directory, and shell. Question 41. What does the /etc/shadow file store? A) User account information B) Encrypted user passwords and password aging information C) Group information D) Network configuration Answer: B Explanation: /etc/shadow stores hashed user passwords and information related to password expiration. Question 42. Which command adds a new user account? A) usermod B) adduser C) passwd D) edituser Answer: B