CompTIA Linux+ XK0-006 Practice Test Questions and Exam Dumps Part 12: Q221–Q240

View Full CompTIA XK0-006 Exam Dumps and Practice Test Dumps.

 

Question 221

Which command is commonly used to create a compressed tar archive using gzip compression?

  1. tar -xzf
  2. tar -czf
  3. tar -tf
  4. tar -rzf

Correct Answer: 2

Explanation

The tar -czf command creates a tar archive and compresses it using gzip. The c option creates the archive, z enables gzip compression, and f specifies the archive filename. This is commonly used for backups, transferring groups of files, or packaging configuration data. Administrators should verify the archive contents after creation when the data is important. The related tar -xzf command is used to extract a gzip-compressed tar archive rather than create one.

Question 222

Which option is commonly used with tar to list the contents of an archive without extracting it?

  1. -c
  2. -x
  3. -t
  4. -r

Correct Answer: 3

Explanation

The -t option tells tar to list the contents of an archive. For example, tar -tzf backup.tar.gz can display the files stored inside a gzip-compressed tar archive without extracting them. This is useful when an administrator wants to inspect a backup before restoring it. The -c option creates an archive, while -x extracts one. Checking archive contents first can help prevent restoring unwanted files or extracting data into the wrong directory.

Question 223

Which Linux utility is commonly used to schedule recurring tasks for individual users?

  1. cron
  2. systemd-login
  3. taskd
  4. jobctl

Correct Answer: 1

Explanation

Cron is a traditional Linux scheduling mechanism used to run commands or scripts at specified times and intervals. User-specific scheduled tasks are commonly managed with crontab. Administrators can schedule backups, cleanup jobs, reports, and other recurring tasks. Each cron entry contains timing fields followed by the command to execute. When troubleshooting a cron job, administrators should check the schedule, command path, permissions, environment variables, and relevant logs because cron may run with a different environment from an interactive shell.

Question 224

Which command opens the current user’s crontab for editing?

  1. cron -edit
  2. crontab -e
  3. editcron
  4. cronedit -u

Correct Answer: 2

Explanation

The crontab -e command opens the current user’s crontab for editing. The administrator can then add scheduled tasks using the standard cron timing format. Using crontab -e is generally preferred over manually editing cron spool files because the command handles the user’s crontab appropriately. A common mistake is using incorrect timing fields or assuming that the cron environment is identical to an interactive shell. Commands should use appropriate paths and permissions to ensure reliable execution.

Question 225

Which command can display the current user’s scheduled cron jobs?

  1. cronlist
  2. crontab -l
  3. cron -show
  4. jobs –cron

Correct Answer: 2

Explanation

The crontab -l command lists the current user’s scheduled cron jobs. It is useful when verifying whether a backup, cleanup task, or other automated command has been configured. Administrators can inspect the schedule and command to identify incorrect entries. If a scheduled task does not run, checking the crontab is an appropriate first step. The administrator should then verify command paths, permissions, environment variables, and logs to determine why the task may be failing.

Question 226

Which Linux permission allows a user to enter a directory and access files when other required permissions are present?

  1. Read
  2. Write
  3. Execute
  4. Setuid

Correct Answer: 3

Explanation

For directories, the execute permission allows a user to enter the directory and access entries when the appropriate permissions are available. Read permission allows the user to list directory contents, while write permission allows changes such as creating or deleting entries when combined with the required permissions. Directory permissions therefore behave differently from file permissions. Administrators should understand this distinction when troubleshooting access problems because a directory can be readable but still prevent users from accessing individual files without execute permission.

Question 227

Which permission is represented by the octal value 755?

  1. rwxr-xr-x
  2. rw-r–r–
  3. rwx——
  4. rw-rw-rw-

Correct Answer: 1

Explanation

The octal permission value 755 represents rwxr-xr-x. The owner has read, write, and execute permissions, while the group and others have read and execute permissions. This is commonly used for executable files and directories that need to be accessible by other users. The first digit applies to the owner, the second to the group, and the third to others. Administrators should avoid giving more permissions than necessary because excessive access can create security risks.

Question 228

Which command changes the permissions of a file or directory?

  1. chown
  2. chmod
  3. chgrp
  4. permset

Correct Answer: 2

Explanation

The chmod command changes the permission bits of files and directories. Administrators can use symbolic notation, such as u+x, or numeric notation, such as 755. Permissions control read, write, and execute access for the owner, group, and others. When changing permissions, administrators should consider the minimum access required by users and applications. Incorrect permissions can cause applications to fail or expose sensitive information, so changes should be tested carefully.

Question 229

Which special permission bit causes an executable file to run with the effective user ID of its owner?

  1. Sticky bit
  2. Setgid
  3. Setuid
  4. ACL

Correct Answer: 3

Explanation

The setuid permission causes an executable program to run with the effective user ID of the file owner. This can allow a program owned by root to perform specific privileged operations for normal users. Because this can create security risks, setuid files should be carefully controlled and regularly reviewed. The setgid bit has different behavior, while the sticky bit is commonly used on shared directories. Administrators should avoid unnecessary privileged executables because vulnerabilities in them can have serious consequences.

Question 230

Which permission feature allows administrators to grant additional permissions to specific users without changing the basic owner/group/other permission bits?

  1. ACL
  2. RAID
  3. LVM
  4. SELinux

Correct Answer: 1

Explanation

Access Control Lists, or ACLs, allow administrators to assign more detailed file and directory permissions to specific users or groups. Traditional Unix permissions provide only owner, group, and other categories, which can be limiting in more complex environments. ACLs can provide additional access without changing the primary ownership structure. Commands such as getfacl and setfacl are commonly used to inspect and modify ACLs. Administrators should document ACLs because complex permission structures can become difficult to maintain.

Question 231

Which command displays ACL entries for a file or directory?

  1. aclshow
  2. getfacl
  3. showacl
  4. lsacl

Correct Answer: 2

Explanation

The getfacl command displays Access Control List entries for files and directories. It can show the standard owner, group, and other permissions as well as additional ACL entries for named users or groups. This is useful when troubleshooting a situation where traditional ls -l output does not fully explain why a user has or lacks access. Administrators can compare getfacl output with the intended access policy before making changes with setfacl.

Question 232

Which command can add a specific user’s ACL entry to a file?

  1. setfacl
  2. addacl
  3. facluser
  4. aclmodify

Correct Answer: 1

Explanation

The setfacl command is used to create or modify ACL entries. For example, an administrator can grant a particular user read and write access to a file without changing the file’s primary owner or group. ACLs are useful when normal Unix permissions cannot represent the required access policy. After changing an ACL, administrators should use getfacl to verify the result. Careful documentation is important because multiple ACL entries can make permissions harder to understand.

Question 233

Which command can display the current hostname of a Linux system?

  1. hostname
  2. hostshow
  3. systemname
  4. machine-name

Correct Answer: 1

Explanation

The hostname command displays the current system hostname when used without additional options. The hostname identifies the system on a network and is commonly used in administration, logging, monitoring, and remote management. A meaningful hostname can make it easier to distinguish servers in a large environment. Administrators should ensure that hostname configuration is consistent with DNS and other system settings when required. Changing a hostname may require additional configuration depending on the Linux distribution.

Question 234

Which command can display detailed information about the operating system and kernel from a standardized system file?

  1. cat /etc/os-release
  2. cat /etc/kernel-name
  3. show-linux-version
  4. osinfo-current

Correct Answer: 1

Explanation

The /etc/os-release file contains identification information about the Linux distribution and release. Running cat /etc/os-release can show values such as the distribution name, version, and identification fields. This is useful when writing scripts that need to determine which Linux distribution is running. Administrators should avoid assuming that all Linux distributions use identical package managers or configuration paths. Checking the operating system release can help select the correct administrative procedure.

Question 235

Which command can display the kernel version currently running on a Linux system?

  1. kernel-version
  2. uname -r
  3. linuxver
  4. syskernel

Correct Answer: 2

Explanation

The uname -r command displays the release version of the currently running Linux kernel. This information is useful when troubleshooting hardware compatibility, driver issues, security updates, and kernel-specific behavior. The installed kernel packages and the running kernel may not always be identical if an update occurred without a reboot. Therefore, administrators should distinguish between the kernel currently running and kernels installed on disk when investigating update-related issues.

Question 236

Which command can display the kernel modules currently loaded into memory?

  1. modlist
  2. lsmod
  3. kernelmodules
  4. showmods

Correct Answer: 2

Explanation

The lsmod command displays currently loaded Linux kernel modules. Modules provide functionality such as hardware drivers, filesystem support, and other kernel features. When troubleshooting hardware or driver problems, administrators can check whether the expected module is loaded. The related modprobe command can load or remove modules while handling dependencies. Administrators should be careful when removing modules because doing so may disrupt hardware or services that depend on them.

Question 237

Which command can load a kernel module while also handling its required dependencies?

  1. insmod
  2. modprobe
  3. loadmod
  4. kernel-add

Correct Answer: 2

Explanation

The modprobe command is commonly used to load or remove Linux kernel modules while handling module dependencies. This makes it more convenient than manually loading individual modules with lower-level tools. If a hardware device requires a particular driver module, an administrator can use modprobe to load it and then verify the result with lsmod or kernel logs. Persistent module loading can require additional configuration depending on the Linux distribution and boot system.

Question 238

Which command can display PCI devices such as network cards and storage controllers?

  1. lsusb
  2. lspci
  3. pcishow
  4. device-pci

Correct Answer: 2

Explanation

The lspci command lists devices connected through the PCI bus. This can include network adapters, storage controllers, graphics hardware, and other expansion devices. It is useful when troubleshooting hardware detection and driver problems. Administrators can often identify the device vendor and model and then compare it with loaded kernel modules or kernel messages. If a PCI device is not behaving correctly, lspci combined with dmesg can provide useful diagnostic information.

Question 239

Which command can display USB devices connected to a Linux system?

  1. usbshow
  2. lsusb
  3. usbdevices
  4. show-usb

Correct Answer: 2

Explanation

The lsusb command lists USB devices detected by the Linux system. It can display device IDs and vendor information, which can help administrators determine whether a USB device is being recognized. When troubleshooting a USB storage device, keyboard, network adapter, or other peripheral, lsusb can be combined with dmesg to see both device detection and kernel messages. If the device is not listed, administrators should also check physical connections, power, hardware compatibility, and relevant drivers.

Question 240

Which command can display information about the CPU architecture, cores, threads, and virtualization support?

  1. cpuinfo
  2. lscpu
  3. processor-show
  4. archinfo

Correct Answer: 2

Explanation

The lscpu command provides detailed information about the system’s CPU architecture and topology. It can show the number of CPUs, cores, threads, sockets, architecture, and supported features. This information is useful when planning workloads, troubleshooting performance, and checking whether virtualization features are available. For example, a virtualization host may need hardware virtualization support enabled in firmware. Administrators can use lscpu as an initial source of CPU information before investigating deeper performance or virtualization issues.