0% found this document useful (0 votes)
9 views42 pages

100 Questions & Answers: Comptia Linux+ Xk0-005

The document is a comprehensive guide for the CompTIA Linux+ XK0-005 exam, featuring 100 practice questions and answers designed to enhance exam readiness through real-world scenarios. It outlines the exam structure, including question domains and their respective weightings, as well as providing insights into the passing criteria. Additionally, it offers practical command-line questions with explanations to reinforce essential Linux concepts.

Uploaded by

maverickd992
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views42 pages

100 Questions & Answers: Comptia Linux+ Xk0-005

The document is a comprehensive guide for the CompTIA Linux+ XK0-005 exam, featuring 100 practice questions and answers designed to enhance exam readiness through real-world scenarios. It outlines the exam structure, including question domains and their respective weightings, as well as providing insights into the passing criteria. Additionally, it offers practical command-line questions with explanations to reinforce essential Linux concepts.

Uploaded by

maverickd992
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

11

CompTIA Linux+ XK0-005

100 Questions & Answers


Welcome to your complete Linux+ XK0-005 practice questions collection. This set is
designed not just for testing — but also to teach, strengthen, and deepen your real
exam readiness through practical, command-line-focused Linux administration
scenarios.

Learning Objectives and Expectations


You’ll get:

 Real-world style questions, modeled after CompTIA exam wording.


 Formatted in sets of 10 questions followed by 10 answers for efficient self-
checking.
 Short explanations to clarify answers and reinforce essential Linux+ concepts.

Linux+ SY0-701 Domains


Each domain is weighted differently on the exam, with Security Operations being the
largest:

 Domain 1: System Management (32%)


 Domain 2: Security (21%)
 Domain 3: Scripting, Containers, and Automation (19%)
 Domain 4: Troubleshooting (28%)

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
22

Quick Reminder: How the Exam Works


 Number of Questions: Up to 90
 Format: Multiple Choice + Performance-Based Questions (PBQs)
 Time Limit: 90 minutes
 Passing Score: 720 / 900
 Test Provider: Pearson VUE (onsite or online)

Questions By Domain
Domain Title Questions Question Numbers
Assigned
Domain 1 System 32 Questions Q1–2, Q5–6, Q10, Q12–13,
Management Q16, Q20–21, Q25–27, Q31–
(32%) 32, Q35, Q41–42, Q50, Q52–
53, Q57, Q62–63, Q66, Q70–
71, Q77–78, Q84, Q86, Q90
Domain 2 Security (21%) 21 Questions Q3, Q7–9, Q15, Q18–19, Q22,
Q30, Q36, Q38–40, Q54, Q59,
Q65, Q72–73, Q75, Q85

Domain 3 Scripting, 19 Questions Q4, Q11, Q14, Q23, Q33–34,


Containers, Q37, Q43–44, Q46, Q51, Q55,
Automation (19%) Q60–61, Q67, Q74, Q79, Q88,
Q95
Domain 4 Troubleshooting 28 Questions Q17, Q24, Q28–29, Q45, Q47–
(28%) 49, Q56, Q58–60, Q64, Q68–
69, Q76, Q80–83, Q87, Q89,
Q91–94, Q96–97, Q99–100

Remember — you don’t need to be perfect to pass!


The passing score is about 80%, meaning you can miss up to 18 questions and still
pass. Focus on understanding and practice, not memorizing every flag.

Missing a few tricky questions won't ruin your chances — stay calm, trust your
preparation, and keep moving forward.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
33

Questions 1–10
Q1.
Which of the following commands is used to display the current runlevel of a Linux
system?
A) runlevel
B) level
C) whoami
D) systemctl

Q2.
What does the chmod 755 command do?
A) Gives read/write to owner only
B) Gives full access to everyone
C) Gives full access to owner, and read/execute to others
D) Denies all access

Q3.
Which file contains the user password aging information on most Linux systems?
A) /etc/passwd
B) /etc/group
C) /etc/[Link]
D) /etc/shadow

Q4.
Which command is used to safely edit the sudoers file?
A) nano /etc/sudoers
B) sudoedit
C) visudo
D) vim /etc/sudoers

Q5.
Which of the following commands can display the UUID of a disk partition?
A) mount
B) blkid
C) fdisk
D) lsblk

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
44

Q6.
What does the useradd -m command do?
A) Adds a user without a home directory
B) Adds a user and creates a home directory
C) Adds a user and assigns sudo
D) Adds a user to /etc/shadow

Q7.
Which file system supports journaling and is commonly used in modern Linux
distributions?
A) FAT32
B) ext2
C) ext4
D) ISO9660

Q8.
Which command will show all currently loaded kernel modules?
A) lsmod
B) modprobe
C) dmesg
D) uname -a

Q9.
Which command can display memory usage in a human-readable format?
A) free -h
B) top
C) vmstat
D) meminfo

Q10.
Which of the following commands will display active network connections and listening
ports?
A) netstat -lntu
B) ping -a
C) ss -a
D) dig +tcp

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
55

Answers 1–10
A1.
Answer: A) runlevel
Explanation: runlevel shows the current and previous system runlevels. It's used in
SysVinit systems, while systemctl get-default is used with systemd.

A2.
Answer: C) Gives full access to owner, and read/execute to others
Explanation: chmod 755 sets permissions to rwxr-xr-x: owner can read/write/execute;
group and others can read/execute.

A3.
Answer: D) /etc/shadow
Explanation: The /etc/shadow file stores encrypted passwords and password aging info
for user accounts.

A4.
Answer: C) visudo
Explanation: visudo checks for syntax errors and locks the sudoers file during editing,
preventing corruption.

A5.
Answer: B) blkid
Explanation: blkid lists block device attributes, including UUIDs, labels, and file system
types.

A6.
Answer: B) Adds a user and creates a home directory
Explanation: The -m option ensures a home directory (e.g., /home/user) is created when
the user is added.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
66

A7.
Answer: C) ext4
Explanation: ext4 is a journaling file system and is widely used in modern Linux distros
for reliability and performance.

A8.
Answer: A) lsmod
Explanation: lsmod lists all currently loaded kernel modules. It's useful for
troubleshooting hardware or driver issues.

A9.
Answer: A) free -h
Explanation: The free command shows memory and swap usage. The -h flag makes the
output human-readable (e.g., MB/GB).

A10.
Answer: A) netstat -lntu
Explanation: This command shows listening (-l), numeric (-n), TCP (-t), and UDP (-u)
ports. It’s commonly used for network diagnostics.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
77

Questions 11–20
Q11.
Which of the following commands is used to modify a user's password expiration
policy?
A) usermod
B) passwd -e
C) chage
D) shadowedit

Q12.
What is the purpose of the /etc/fstab file?
A) Manages DNS name resolution
B) Stores startup services
C) Lists user password settings
D) Configures mount points for filesystems

Q13.
Which command allows you to view the last system boot messages from the kernel ring
buffer?
A) dmesg
B) journalctl
C) syslog
D) uptime

Q14.
What is the result of the following command: grep "^root" /etc/passwd?
A) Finds all users with root privileges
B) Searches for any user whose name starts with "root"
C) Shows every user account
D) Locates password hashes for root

Q15.
Which of the following commands will show information about LVM logical volumes?
A) lvscan
B) fdisk -l

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
88

C) mkfs.ext4
D) mount -a

Q16.
What is the main role of the systemd init system?
A) Disk partitioning
B) Boot loader management
C) Service and process management
D) GUI configuration

Q17.
Which file contains user-defined environment variables for Bash shell sessions?
A) /etc/environment
B) ~/.bashrc
C) ~/.profile
D) All of the above

Q18.
Which tool is best for capturing live network traffic on a Linux server?
A) netstat
B) ping
C) tcpdump
D) ss

Q19.
Which of the following commands is used to install a .deb package manually?
A) yum install
B) apt-get build
C) dpkg -i
D) rpm -ivh

Q20.
Which RAID level uses mirroring to provide redundancy?
A) RAID 0
B) RAID 1
C) RAID 5
D) RAID 6

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
99

Answers 11–20
A11.
Answer: C) chage
Explanation: chage modifies user password aging and expiration policies. Use chage -l
user to list current settings.

A12.
Answer: D) Configures mount points for filesystems
Explanation: /etc/fstab defines which filesystems to mount, where, and with what
options during system boot.

A13.
Answer: A) dmesg
Explanation: dmesg reads messages from the kernel ring buffer — usually showing boot
and hardware info.

A14.
Answer: B) Searches for any user whose name starts with "root"
Explanation: The ^ anchor in grep means “start of line”, so it matches lines that begin
with "root".

A15.
Answer: A) lvscan
Explanation: lvscan scans all volume groups and lists logical volumes created using
LVM.

A16.
Answer: C) Service and process management
Explanation: systemd is the system and service manager used in most modern Linux
distributions to control system startup and manage services.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
10
10

A17.
Answer: D) All of the above
Explanation: Environment variables can be defined globally in /etc/environment, or per-
user in ~/.bashrc or ~/.profile.

A18.
Answer: C) tcpdump
Explanation: tcpdump captures live packet traffic on interfaces and is ideal for detailed
packet-level network troubleshooting.

A19.
Answer: C) dpkg -i
Explanation: dpkg -i [Link] is used to manually install Debian packages. Use apt
for automatic dependency handling.

A20.
Answer: B) RAID 1
Explanation: RAID 1 provides redundancy by mirroring data across two or more drives.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
11
11

Questions 21–30
Q21.
Which command would you use to determine which ports a service is actively listening
on?
A) netstat -tulpn
B) nmap localhost
C) ping -p
D) dig

Q22.
Which shell feature allows the use of | to send the output of one command to another?
A) Wildcards
B) Pipes
C) Globbing
D) Variables

Q23.
What is the purpose of cron in Linux systems?
A) Monitor processes
B) Schedule repetitive tasks
C) Track user logins
D) Compress backups

Q24.
What does the umask command control?
A) Active shell
B) Default permission bits for new files/directories
C) Encrypted file systems
D) Disk quota

Q25.
You need to allow a web server to listen on port 80 using firewalld. What command
should you run?
A) ufw allow http
B) firewall-cmd --add-service=http --permanent

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
12
12

C) iptables -A INPUT -p tcp --dport 443 -j ACCEPT


D) firewalld enable httpd

Q26.
Which of the following describes a symbolic link?
A) A file copy
B) A filesystem snapshot
C) A reference that points to another file
D) A compressed version of a file

Q27.
What is the function of the awk command in Linux?
A) Encrypt data
B) Compile software
C) Format and extract fields from text
D) List open files

Q28.
Which of the following is true about sudo?
A) Allows any user to run anything
B) Grants limited administrative privileges
C) Requires a reboot to activate
D) Only works with GUI applications

Q29.
What is stored in the /var/log directory?
A) Kernel modules
B) User home directories
C) System logs
D) Installed packages

Q30.
Which command will search recursively for the string "error" in all .log files under
/var/log?
A) grep error /var/log/*.log
B) grep -r error /var/log/*.log

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
13
13

C) find /var/log -name "*.log" | grep error


D) grep -r "error" /var/log

Answers 21–30
A21.
Answer: A) netstat -tulpn
Explanation: Displays all TCP/UDP ports with process names and PID. Replaced in
some distros by ss.

A22.
Answer: B) Pipes
Explanation: A pipe (|) allows the output of one command to be passed as input to
another. Example: ps aux | grep apache.

A23.
Answer: B) Schedule repetitive tasks
Explanation: cron is used to schedule scripts or commands to run at specific intervals
(daily, weekly, etc.).

A24.
Answer: B) Default permission bits for new files/directories
Explanation: umask sets which permission bits will be "masked out" when new files are
created.

A25.
Answer: B) firewall-cmd --add-service=http --permanent
Explanation: This adds the HTTP service to firewalld permanently. Don’t forget to --
reload.

A26.
Answer: C) A reference that points to another file
Explanation: A symbolic link is like a shortcut or pointer to another file or directory.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
14
14

A27.
Answer: C) Format and extract fields from text
Explanation: awk is a powerful text-processing tool used for manipulating and
extracting column-based data.

A28.
Answer: B) Grants limited administrative privileges
Explanation: sudo allows controlled access to root commands without switching to
root directly.

A29.
Answer: C) System logs
Explanation: /var/log holds system, application, and service logs like syslog, [Link],
and dmesg.

A30.
Answer: D) grep -r "error" /var/log
Explanation: -r enables recursive search. To target only .log files, use find or combine
grep with --include.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
15
15

Questions 31–40
Q31.
What is the purpose of the tar command in Linux?
A) Extract data from databases
B) Monitor services
C) Archive and compress files
D) Encrypt files

Q32.
Which directory contains configuration files for installed services and the system?
A) /var
B) /etc
C) /opt
D) /tmp

Q33.
Which command is used to check and repair Linux filesystems?
A) fdisk
B) e2fsck
C) mkfs
D) mount

Q34.
What command is used to build a custom kernel module into a running system?
A) insmod
B) lsmod
C) modinfo
D) rmmod

Q35.
What does the df -h command display?
A) Memory usage
B) File ownership
C) Human-readable disk usage by mount point
D) Inode count

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
16
16

Q36.
Which log file typically records failed login attempts and authentication issues?
A) /var/log/messages
B) /var/log/dmesg
C) /var/log/[Link]
D) /etc/passwd

Q37.
What is the effect of running chmod 700 [Link]?
A) Only the owner can read, write, and execute the file
B) Everyone can execute the file
C) Group and others can read but not execute
D) The file becomes hidden

Q38.
Which option would you use with grep to ignore case sensitivity when searching?
A) -v
B) -n
C) -i
D) -r

Q39.
What is the purpose of the cut command?
A) Edit large files
B) Select and extract fields from lines of input
C) Remove lines
D) Sort lines alphabetically

Q40.
Which command is used to update the list of available packages on a Debian-based
system?
A) apt upgrade
B) apt install
C) apt update
D) dpkg -l

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
17
17

Answers 31–40
A31.
Answer: C) Archive and compress files
Explanation: tar is used to create and manipulate archive files. Often combined with
compression: tar -czvf.

A32.
Answer: B) /etc
Explanation: This directory contains system-wide configuration files and startup
scripts.

A33.
Answer: B) e2fsck
Explanation: e2fsck checks and repairs ext-based filesystems. It’s often used on
unmounted volumes.

A34.
Answer: A) insmod
Explanation: insmod inserts a kernel module into the running kernel. Use modprobe for
dependency handling.

A35.
Answer: C) Human-readable disk usage by mount point
Explanation: df shows disk space by mount; -h gives sizes in KB/MB/GB.

A36.
Answer: C) /var/log/[Link]
Explanation: This log stores authentication-related events like sudo and failed logins.

A37.
Answer: A) Only the owner can read, write, and execute the file

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
18
18

Explanation: 700 gives full permissions to the owner, and no permissions to


group/others.

A38.
Answer: C) -i
Explanation: The -i option ignores case sensitivity. Example: grep -i "linux".

A39.
Answer: B) Select and extract fields from lines of input
Explanation: cut is used to slice out specific sections from text. Example: cut -d ':' -f1
/etc/passwd.

A40.
Answer: C) apt update
Explanation: apt update refreshes the package list. Follow with apt upgrade to install
updates.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
19
19

Questions 41–50
Q41.
What is the default shell for most Linux distributions?
A) csh
B) fish
C) bash
D) zsh

Q42.
Which command will recursively change ownership of a directory and all its contents?
A) chmod -R
B) chown -R
C) usermod -R
D) setfacl -m

Q43.
Which system file defines static hostname configuration in most Linux distributions?
A) /etc/network/interfaces
B) /etc/hostname
C) /etc/hosts
D) /etc/[Link]

Q44.
Which option for the ps command displays all processes in full detail across users?
A) ps aux
B) ps -p
C) ps -e
D) ps u

Q45.
Which command displays real-time CPU usage, load average, and running processes?
A) htop
B) ps
C) who
D) kill

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
20
20

Q46.
What is the default location for a non-root user's crontab?
A) /etc/crontab
B) /etc/cron.d/user
C) /var/spool/cron/username
D) ~/.crontab

Q47.
Which of the following files is used to define a persistent static IP address on systems
using Netplan?
A) /etc/network/interfaces
B) /etc/netplan/[Link]
C) /etc/systemd/[Link]
D) /etc/dhcp/[Link]

Q48.
What will the echo $? command display?
A) Last background process PID
B) The current shell level
C) The return code of the last executed command
D) The value of the last positional parameter

Q49.
What does the tee command do?
A) Compresses input to a file
B) Writes output to a file and to stdout simultaneously
C) Removes duplicate lines
D) Displays a tree view of the file system

Q50.
Which file controls global environment variables set at login for all users?
A) /etc/profile
B) ~/.bash_profile
C) ~/.bashrc
D) /etc/passwd

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
21
21

Answers 41–50
A41.
Answer: C) bash
Explanation: Most Linux distributions default to the Bourne Again SHell (bash),
especially for scripting and administration.

A42.
Answer: B) chown -R
Explanation: The -R (recursive) option tells chown to change ownership of the directory
and all files/subdirectories within it.

A43.
Answer: B) /etc/hostname
Explanation: This file stores the system's static hostname. It’s read during boot to set
the system name.

A44.
Answer: A) ps aux
Explanation: ps aux lists all processes across all users with full details including PID,
CPU/mem usage, and command.

A45.
Answer: A) htop
Explanation: htop is an enhanced, real-time system monitor for processes, CPU,
memory, and load averages.

A46.
Answer: C) /var/spool/cron/username
Explanation: User-specific crontabs are stored in this directory and managed via the
crontab command.

A47.
Answer: B) /etc/netplan/[Link]

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
22
22

Explanation: Netplan uses YAML files stored in /etc/netplan/ to configure networking in


modern Ubuntu-based systems.

A48.
Answer: C) The return code of the last executed command
Explanation: $? holds the exit status of the last command: 0 means success, non-zero
means error.

A49.
Answer: B) Writes output to a file and to stdout simultaneously
Explanation: tee is useful in scripts and pipelines where you want output to go both to
the screen and a file.

A50.
Answer: A) /etc/profile
Explanation: This script sets global environment variables at login. It's sourced for all
users in login shells.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
23
23

Questions 51–60
Q51.
Which command will list all available services and their statuses on a systemd-based
system?
A) service --list
B) systemctl list-units --type=service
C) chkconfig --list
D) initctl list

Q52.
Which file defines the primary DNS server for name resolution on a Linux system?
A) /etc/hostname
B) /etc/hosts
C) /etc/[Link]
D) /etc/[Link]

Q53.
Which of the following commands would display the kernel version?
A) uname -a
B) dmesg | head
C) uptime
D) ls /boot

Q54.
Which of the following is a journaling file system?
A) ext2
B) ext4
C) FAT32
D) ISO9660

Q55.
What is the primary function of the modprobe command?
A) Remove memory modules
B) Rebuild the GRUB config
C) Load kernel modules with dependencies
D) Display system logs

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
24
24

Q56.
What does the history command do?
A) Displays past file modifications
B) Shows bash command history
C) Tracks login events
D) Audits kernel changes

Q57.
What option with the ls command displays file sizes in human-readable format?
A) -a
B) -s
C) -h
D) -r

Q58.
Which command is used to create a new logical volume in LVM?
A) mkfs
B) lvcreate
C) vgcreate
D) pvcreate

Q59.
What does the /etc/ssh/sshd_config file configure?
A) SSH client behavior
B) SSH server settings
C) Firewall rules for port 22
D) Public key encryption settings

Q60.
Which environment variable contains the list of directories the shell searches for
executables?
A) USER
B) SHELL
C) HOME
D) PATH

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
25
25

Answers 51–60
A51.
Answer: B) systemctl list-units --type=service
Explanation: This command shows all active services managed by systemd on the
system.

A52.
Answer: D) /etc/[Link]
Explanation: This file defines nameservers used for DNS resolution.

A53.
Answer: A) uname -a
Explanation: uname -a displays full system info, including kernel version, architecture,
and hostname.

A54.
Answer: B) ext4
Explanation: ext4 is a modern journaling file system, commonly used by many Linux
distros.

A55.
Answer: C) Load kernel modules with dependencies
Explanation: modprobe loads a kernel module and any dependencies. It’s safer than
insmod.

A56.
Answer: B) Shows bash command history
Explanation: history shows previously entered shell commands, stored per user.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
26
26

A57.
Answer: C) -h
Explanation: Combined with -l, it shows sizes in KB/MB/GB instead of bytes: ls -lh.

A58.
Answer: B) lvcreate
Explanation: lvcreate is used to create logical volumes within a volume group in LVM.

A59.
Answer: B) SSH server settings
Explanation: This file controls how the OpenSSH server (sshd) behaves (e.g., port, root
login, key auth).

A60.
Answer: D) PATH
Explanation: PATH tells the shell where to look for executables when commands are
run.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
27
27

Questions 61–70
Q61.
Which command is used to display the current disk I/O statistics?
A) uptime
B) vmstat
C) iostat
D) dstat

Q62.
What does the cut -d ':' -f1 /etc/passwd command do?
A) Counts users
B) Displays all full lines
C) Lists only usernames
D) Lists only passwords

Q63.
Which of the following commands will archive a directory and compress it with gzip?
A) tar -czf [Link] /dir
B) gzip /dir
C) zip /dir
D) tar -xzf [Link]

Q64.
Which command shows who is currently logged into the system?
A) whoami
B) who
C) usershow
D) id

Q65.
What is the purpose of the /etc/[Link] file?
A) Maps user to home directories
B) Defines order of name resolution methods
C) Configures sudo access
D) Mounts remote file systems

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
28
28

Q66.
Which of the following best describes the function of a sticky bit on a directory?
A) Prevents deletion of any files
B) Allows users to modify group files
C) Only the file owner can delete their files
D) Makes files read-only

Q67.
How would you list the last 20 lines of a system log file?
A) logtail -n 20
B) tail -n 20 /var/log/syslog
C) view /var/log/syslog 20
D) less /var/log/syslog -n 20

Q68.
Which command will recursively find files with .conf extension in /etc?
A) find /etc -name "*.conf"
B) grep -r "*.conf" /etc
C) locate /etc/*.conf
D) ls /etc/*.conf -R

Q69.
Which Linux command would be used to examine and filter packet traffic on a specific
network interface?
A) nmap
B) tcpdump
C) dig
D) traceroute

Q70.
What does the lsof command do?
A) Lists open files and the processes using them
B) Opens file editors
C) Formats logs
D) Mounts file systems

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
29
29

Answers 61–70
A61.
Answer: C) iostat
Explanation: iostat shows CPU stats and disk I/O performance, useful for diagnosing
disk bottlenecks.

A62.
Answer: C) Lists only usernames
Explanation: This command uses : as a delimiter and extracts the first field (username)
from /etc/passwd.

A63.
Answer: A) tar -czf [Link] /dir
Explanation: This command creates a gzip-compressed tar archive from the /dir
directory.

A64.
Answer: B) who
Explanation: who shows currently logged-in users, their terminals, and login times.

A65.
Answer: B) Defines order of name resolution methods
Explanation: /etc/[Link] tells Linux how to resolve names (e.g., DNS, files,
LDAP).

A66.
Answer: C) Only the file owner can delete their files
Explanation: Sticky bit (mode 1777) is used on directories like /tmp to restrict deletions.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
30
30

A67.
Answer: B) tail -n 20 /var/log/syslog
Explanation: tail with -n shows the last N lines of a file.

A68.
Answer: A) find /etc -name "*.conf"
Explanation: This finds all .conf files under /etc recursively.

A69.
Answer: B) tcpdump
Explanation: tcpdump captures and analyzes packets on specified interfaces.

A70.
Answer: A) Lists open files and the processes using them
Explanation: lsof ("List Open Files") is great for diagnosing locked files, open ports, and
usage conflicts.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
31
31

Questions 71–80
Q71.
What is the purpose of the mount command in Linux?
A) Format disk partitions
B) Scan for devices
C) Attach file systems to the directory tree
D) Encrypt directories

Q72.
What does chmod +x [Link] do?
A) Deletes the script
B) Compiles the script
C) Makes the script executable
D) Schedules the script to run at boot

Q73.
Which of the following symbols represents the root directory?
A) ~
B) /
C) ..
D) .

Q74.
What is the purpose of the /etc/hosts file?
A) Stores DNS server IPs
B) Maps IP addresses to hostnames locally
C) Lists blocked domains
D) Sets SSH server policies

Q75.
Which utility is used to monitor and manage SELinux security contexts?
A) auditctl
B) getenforce
C) sshd_config
D) gpasswd

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
32
32

Q76.
Which command allows you to search for packages in Debian-based distributions?
A) apt update
B) apt install
C) apt-cache search
D) dpkg -i

Q77.
Which command is used to configure a persistent hostname on most modern systems?
A) sethostname
B) echo myhost > /etc/hostname
C) hostnamectl set-hostname myhost
D) sysctl hostname=myhost

Q78.
What type of file is /dev/sda in Linux?
A) Regular file
B) Symbolic link
C) Device file
D) Archive

Q79.
Which of the following allows scheduling tasks on boot for systemd systems?
A) /etc/[Link]
B) @reboot in crontab
C) systemctl enable <service>
D) [Link]

Q80.
Which command will count the number of lines in a text file?
A) wc -l [Link]
B) cat [Link] | count
C) awk '{lines++} END {print lines}' [Link]
D) Both A and C

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
33
33

Answers 71–80
A71.
Answer: C) Attach file systems to the directory tree
Explanation: mount connects storage devices or partitions to a mount point in the
filesystem hierarchy.

A72.
Answer: C) Makes the script executable
Explanation: +x adds execute permission to the file, allowing it to be run as a program.

A73.
Answer: B) /
Explanation: The single forward slash (/) is the root directory of the Linux filesystem.

A74.
Answer: B) Maps IP addresses to hostnames locally
Explanation: /etc/hosts is used for static hostname-to-IP mapping, bypassing DNS.

A75.
Answer: B) getenforce
Explanation: getenforce shows if SELinux is in enforcing, permissive, or disabled mode.

A76.
Answer: C) apt-cache search
Explanation: This searches package names and descriptions in APT repositories.

A77.
Answer: C) hostnamectl set-hostname myhost
Explanation: The hostnamectl command is the preferred way to set hostnames on
systemd-based systems.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
34
34

A78.
Answer: C) Device file
Explanation: /dev/sda is a block device file representing a physical or virtual hard disk.

A79.
Answer: C) systemctl enable <service>
Explanation: This ensures the service starts automatically at boot using systemd.

A80.
Answer: D) Both A and C
Explanation: wc -l counts lines efficiently. The awk alternative also works by
incrementing a counter per line.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
35
35

Questions 81–90
Q81.
Which of the following commands will display a user’s group memberships?
A) groups
B) id -Gn
C) getent group
D) All of the above

Q82.
Which command is used to safely shut down a Linux system immediately?
A) reboot now
B) shutdown now
C) poweroff
D) Both B and C

Q83.
Which environment variable defines the user’s home directory?
A) HOME
B) USER
C) SHELL
D) PATH

Q84.
What is the result of running sudo !!?
A) Executes the previous command as root
B) Logs out the user
C) Cancels the last command
D) Displays sudo history

Q85.
What is the primary purpose of /etc/[Link]?
A) Set cron job defaults
B) Define password policies and aging rules
C) Map hostnames to IP addresses
D) Set up SSH server options

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
36
36

Q86.
Which command shows available disk space on mounted file systems?
A) lsblk
B) du
C) df
D) mount

Q87.
What is the command to create a 2GB swap file?
A) dd if=/dev/zero of=/swapfile bs=1G count=2
B) [Link] /swapfile
C) touch /swapfile 2G
D) swapoff -a

Q88.
Which command would you use to view the contents of a .[Link] archive without
extracting it?
A) tar -czf [Link]
B) tar -tf [Link]
C) gunzip [Link]
D) gzip -l [Link]

Q89.
Which command will remove an LVM logical volume?
A) lvremove /dev/vgname/lvname
B) vgremove /dev/vgname
C) pvremove /dev/sdX
D) umount /dev/vgname/lvname

Q90.
Which command is used to modify firewall settings using firewalld on RHEL-based
systems?
A) ufw
B) iptables
C) nft
D) firewall-cmd

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
37
37

Answers 81–90
A81.
Answer: D) All of the above
Explanation: All listed commands can display group membership. groups and id -Gn
show concise group lists; getent group shows full database entries.

A82.
Answer: D) Both B and C
Explanation: shutdown now and poweroff both immediately halt and power off the
system safely.

A83.
Answer: A) HOME
Explanation: The HOME variable holds the absolute path to a user's home directory.

A84.
Answer: A) Executes the previous command as root
Explanation: !! recalls the last command. sudo !! runs it with elevated privileges.

A85.
Answer: B) Define password policies and aging rules
Explanation: /etc/[Link] sets system-wide defaults for password aging, UID ranges,
and more.

A86.
Answer: C) df
Explanation: df displays disk space usage for mounted filesystems. Use df -h for
human-readable output.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
38
38

A87.
Answer: A) dd if=/dev/zero of=/swapfile bs=1G count=2
Explanation: This creates a 2GB file filled with zeros, commonly used for swap
configuration.

A88.
Answer: B) tar -tf [Link]
Explanation: The -t option lists archive contents without extracting. Use with -z for .gz
files.

A89.
Answer: A) lvremove /dev/vgname/lvname
Explanation: lvremove deletes logical volumes. Make sure the volume is unmounted
first.

A90.
Answer: D) firewall-cmd
Explanation: firewall-cmd is used on systems with firewalld to add/remove rules and
services.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
39
39

Questions 91–100
Q91.
Which command can display detailed information about a specific package on a
Debian-based system?
A) dpkg -l
B) dpkg -s <package>
C) apt list
D) dpkg --configure

Q92.
What is the primary function of the /var directory?
A) Store user profiles
B) Hold system logs and variable data
C) Store boot-related files
D) Contain installed applications

Q93.
Which Linux command can display the current user ID (UID) and group ID (GID)?
A) groups
B) whoami
C) id
D) env

Q94.
What is the function of the journalctl command?
A) Displays current processes
B) Views systemd logs
C) Shows scheduled cron jobs
D) Displays installed services

Q95.
Which system file stores user password hashes?
A) /etc/passwd
B) /etc/shadow
C) /etc/[Link]
D) /etc/group

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
40
40

Q96.
What command will display your system’s default target (runlevel in systemd)?
A) runlevel
B) initctl
C) systemctl get-default
D) targetctl status

Q97.
What is the difference between > and >> in shell redirection?
A) No difference
B) > appends; >> overwrites
C) > overwrites; >> appends
D) Both delete existing files

Q98.
Which command is used to compare the contents of two files line by line?
A) cat
B) cmp
C) diff
D) ls -l

Q99.
Which of the following is a benefit of using containers?
A) Higher RAM capacity
B) GUI virtualization
C) Lightweight, portable application environments
D) Rootless shell access

Q100.
Which command would be used to reload firewalld after adding a new rule?
A) systemctl restart firewall
B) firewalld reload
C) firewall-cmd --reload
D) iptables --reload

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
41
41

Answers 91–100
A91.
Answer: B) dpkg -s <package>
Explanation: This command shows status, version, description, and dependencies of a
specific installed package.

A92.
Answer: B) Hold system logs and variable data
Explanation: The /var directory stores log files, mail spools, caches, and other changing
data.

A93.
Answer: C) id
Explanation: id shows the user ID, group ID, and groups the current user belongs to.

A94.
Answer: B) Views systemd logs
Explanation: journalctl accesses the systemd journal — useful for viewing service logs
and boot messages.

A95.
Answer: B) /etc/shadow
Explanation: This file holds secure, hashed user passwords. It's only readable by root.

A96.
Answer: C) systemctl get-default
Explanation: This command shows the default systemd target (e.g., [Link],
[Link]).

A97.
Answer: C) > overwrites; >> appends
Explanation: > creates a new file or overwrites it. >> appends to the file if it exists.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0
42
42

A98.
Answer: C) diff
Explanation: diff compares files line by line and highlights differences.

A99.
Answer: C) Lightweight, portable application environments
Explanation: Containers isolate apps with minimal overhead, making them ideal for
CI/CD and microservices.

A100.
Answer: C) firewall-cmd --reload
Explanation: After changing firewalld rules, this command applies them without
restarting the service.

© 2025 · Curated by Artem Polynko · Follow on LinkedIn


Latest Guide Versions: [Link]
Based on personal research and insights · Feel free to share with friends · Not for resale Version 1.0

You might also like