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?
- tar -xzf
- tar -czf
- tar -tf
- 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?
- -c
- -x
- -t
- -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?
- cron
- systemd-login
- taskd
- 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?
- cron -edit
- crontab -e
- editcron
- 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?
- cronlist
- crontab -l
- cron -show
- 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?
- Read
- Write
- Execute
- 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?
- rwxr-xr-x
- rw-r–r–
- rwx——
- 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?
- chown
- chmod
- chgrp
- 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?
- Sticky bit
- Setgid
- Setuid
- 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?
- ACL
- RAID
- LVM
- 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?
- aclshow
- getfacl
- showacl
- 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?
- setfacl
- addacl
- facluser
- 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?
- hostname
- hostshow
- systemname
- 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?
- cat /etc/os-release
- cat /etc/kernel-name
- show-linux-version
- 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?
- kernel-version
- uname -r
- linuxver
- 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?
- modlist
- lsmod
- kernelmodules
- 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?
- insmod
- modprobe
- loadmod
- 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?
- lsusb
- lspci
- pcishow
- 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?
- usbshow
- lsusb
- usbdevices
- 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?
- cpuinfo
- lscpu
- processor-show
- 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.