ExamGecko
Home Home / CompTIA / XK0-005

CompTIA XK0-005 Practice Test - Questions Answers, Page 28

Question list
Search
Search

List of questions

Search

Related questions











Users are reporting that writes on a system configured with SSD drives have been taking longer than expected, but reads do not seem to be affected. A Linux systems administrator is investigating this issue and working on a solution. Which of the following should the administrator do to help solve the issue?

A.
Run the corresponding command to trim the SSD drives.
A.
Run the corresponding command to trim the SSD drives.
Answers
B.
Use fsck on the filesystem hosted on the SSD drives.
B.
Use fsck on the filesystem hosted on the SSD drives.
Answers
C.
Migrate to high-density SSD drives for increased performance.
C.
Migrate to high-density SSD drives for increased performance.
Answers
D.
Reduce the amount of files on the SSD drives.
D.
Reduce the amount of files on the SSD drives.
Answers
Suggested answer: A

Explanation:

TRIM is a feature that allows the operating system to inform the SSD which blocks of data are no longer in use and can be wiped internally.This helps to maintain the SSD's performance and endurance by preventing unnecessary write operations and reducing write amplification12.Running the corresponding command to trim the SSD drives, such asfstrimorblkdiscardon Linux, can help to solve the issue of slow writes by freeing up space and optimizing the SSD's internal garbage collection34.

The development team created a new branch with code changes that a Linux administrator needs to pull from the remote repository. When the administrator looks for the branch in Git, the branch in question is not visible. Which of the following commands should the Linux administrator run to refresh the branch information?

A.
git fetch
A.
git fetch
Answers
B.
git checkout
B.
git checkout
Answers
C.
git clone
C.
git clone
Answers
D.
git branch
D.
git branch
Answers
Suggested answer: A

Explanation:

The git fetch command downloads commits, files, and refs from a remote repository into the local one. It also updates the remote-tracking branches, which are references to the state of the remote branches.By running git fetch, the administrator can see the new branch created by the development team and then use git checkout to switch to it12.

A file called testfile has both uppercase and lowercase letters:

$ cat testfile

ABCDEfgH

IJKLmnoPQ

abcdefgH

ijklLMNopq

A Linux administrator is tasked with converting testfile into all uppercase and writing it to a new file with the name uppercase. Which of the following commands will achieve this task?

A.
tr '(A-Z}' '{a-z}' < testfile > uppercase
A.
tr '(A-Z}' '{a-z}' < testfile > uppercase
Answers
B.
echo testfile | tr '[Z-A]' '[z-a]' < testfile > uppercase
B.
echo testfile | tr '[Z-A]' '[z-a]' < testfile > uppercase
Answers
C.
cat testfile | tr '{z-a)' '{Z-A}' < testfile > uppercase
C.
cat testfile | tr '{z-a)' '{Z-A}' < testfile > uppercase
Answers
D.
tr '[a-z]' '[A-Z]' < testfile > uppercase
D.
tr '[a-z]' '[A-Z]' < testfile > uppercase
Answers
Suggested answer: D

Explanation:

This command will use the tr tool to translate all lowercase letters in the testfile to uppercase letters and write the output to the uppercase file. The first argument '[a-z]' specifies the set of characters to be replaced, and the second argument '[A-Z]' specifies the set of characters to replace with.The '<' symbol redirects the input from the testfile, and the '>' symbol redirects the output to the uppercase file12.

A Linux administrator is troubleshooting a systemd mount unit file that is not working correctly. The file contains:

[root@system] # cat mydocs.mount

[Unit]

Description=Mount point for My Documents drive

[Mount]

What=/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34

Where=/home/user1/My Documents

Options=defaults

Type=xfs

[Install]

WantedBy=multi-user.target

The administrator verifies the drive UUID correct, and user1 confirms the drive should be mounted as My Documents in the home directory. Which of the following can the administrator do to fix the issues with mounting the drive? (Select two).

A.
Rename the mount file to home-user1-My\x20Documents.mount.
A.
Rename the mount file to home-user1-My\x20Documents.mount.
Answers
B.
Rename the mount file to home-user1-my-documents.mount.
B.
Rename the mount file to home-user1-my-documents.mount.
Answers
C.
Change the What entry to /dev/drv/disk/by-uuid/94afc9b2\-ac34\-ccff\-88ae\-297ab3c7ff34.
C.
Change the What entry to /dev/drv/disk/by-uuid/94afc9b2\-ac34\-ccff\-88ae\-297ab3c7ff34.
Answers
D.
Change the Where entry to Where=/home/user1/my\ documents.
D.
Change the Where entry to Where=/home/user1/my\ documents.
Answers
E.
Change the Where entry to Where=/home/user1/My\x20Documents.
E.
Change the Where entry to Where=/home/user1/My\x20Documents.
Answers
F.
Add quotes to the What and Where entries, such as What='/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34' and Where='/home/user1/My Documents'.
F.
Add quotes to the What and Where entries, such as What='/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34' and Where='/home/user1/My Documents'.
Answers
Suggested answer: A, E

Explanation:

The mount unit file name and the Where entry must be escaped to handle spaces in the path. Reference The mount unit file name must be named after the mount point directory, with spaces replaced by\x20. SeeHow to escape spaces in systemd unit files?andsystemd.mount. The Where entry must use\x20to escape spaces in the path. Seesystemd.mountandThe workaround is to use /usr/bin/env followed by the path in quotes..

Following the migration from a disaster recovery site, a systems administrator wants a server to require a user to change credentials at initial login. Which of the following commands should be used to ensure the aging attribute?

A.
chage -d 2 user
A.
chage -d 2 user
Answers
B.
chage -d 0 user
B.
chage -d 0 user
Answers
C.
chage -E 0 user
C.
chage -E 0 user
Answers
D.
chage -d 1 user
D.
chage -d 1 user
Answers
Suggested answer: B

Explanation:

The chage command can be used to change the user password expiry information. The -d or --lastday option sets the last password change date. If the value is 0, the user will be forced to change the password at the next login. Seechage command in Linux with examplesand10 chage command examples in Linux.

A systems administrator needs to remove a disk from a Linux server. The disk size is 500G, and it is the only one that size on that machine. Which of the following commands can the administrator use to find the corresponding device name?

A.
fdisk -V
A.
fdisk -V
Answers
B.
partprobe -a
B.
partprobe -a
Answers
C.
lsusb -t
C.
lsusb -t
Answers
D.
lsscsi -s
D.
lsscsi -s
Answers
Suggested answer: D

Explanation:

The lsscsi command can list the SCSI devices on the system, along with their size and device name. The -s option shows the size of each device. The administrator can look for the device that has a size of 500G and note its device name. Seelsscsi(8) - Linux man pageandHow to check Disk Interface Types in Linux. Reference 1: https://linux.die.net/man/8/lsscsi 2: https://www.golinuxcloud.com/check-disk-type-linux/

A Linux user is trying to execute commands with sudo but is receiving the following error:

$ sudo visudo

>>> /etc/sudoers: syntax error near line 28 <<<

sudo: parse error in /etc/sudoers near line 28

sudo: no valid sudoers sources found, quitting

The following output is provided:

# grep root /etc/shadow

root :* LOCK *: 14600 ::::::

Which of the following actions will resolve this issue?

A.
Log in directly using the root account and comment out line 28 from /etc/sudoers.
A.
Log in directly using the root account and comment out line 28 from /etc/sudoers.
Answers
B.
Boot the system in single user mode and comment out line 28 from /etc/sudoers.
B.
Boot the system in single user mode and comment out line 28 from /etc/sudoers.
Answers
C.
Comment out line 28 from /etc/sudoers and try to use sudo again.
C.
Comment out line 28 from /etc/sudoers and try to use sudo again.
Answers
D.
Log in to the system using the other regular user, switch to root, and comment out line 28 from /etc/sudoers.
D.
Log in to the system using the other regular user, switch to root, and comment out line 28 from /etc/sudoers.
Answers
Suggested answer: B

A systems administrator is gathering information about a file type and the contents of a file. Which of the following commands should the administrator use to accomplish this task?

A.
file filename
A.
file filename
Answers
B.
touch filename
B.
touch filename
Answers
C.
grep filename
C.
grep filename
Answers
D.
lsof filename
D.
lsof filename
Answers
Suggested answer: A

Explanation:

The file command is used to determine the type of a file by examining its contents. It can recognize many different formats, such as text, binary, executable, compressed, image, audio, video, etc.It can also display some additional information about the file, such as encoding, size, dimensions, etc12

Due to performance issues on a server, a Linux administrator needs to termi-nate an unresponsive process. Which of the following commands should the administrator use to terminate the process immediately without waiting for a graceful shutdown?

A.
kill -SIGKILL 5545
A.
kill -SIGKILL 5545
Answers
B.
kill -SIGTERM 5545
B.
kill -SIGTERM 5545
Answers
C.
kill -SIGHUP 5545
C.
kill -SIGHUP 5545
Answers
D.
kill -SIGINT 5545
D.
kill -SIGINT 5545
Answers
Suggested answer: A

Explanation:

To terminate an unresponsive process immediately without waiting for a graceful shutdown, the administrator can use the commandkill -SIGKILL 5545(A). This will send a signal to the process with the PID 5545 that cannot be ignored or handled by the process, and force it to stop. The other commands will send different signals that may allow the process to perform some cleanup or termination actions, or may be ignored by the process.Reference:

[CompTIA Linux+ Study Guide], Chapter 6: Managing Processes, Section: Killing Processes

[How to Kill Processes in Linux]

A systems administrator intends to use a UI-JID to mount a new partition per-manently on a Linux system. Which of the following commands can the adminis-trator run to obtain information about the UUlDs of all disks attached to a Linux system?

A.
fcstat
A.
fcstat
Answers
B.
blkid
B.
blkid
Answers
C.
dmsetup
C.
dmsetup
Answers
D.
Isscsi
D.
Isscsi
Answers
Suggested answer: B

Explanation:

To obtain information about the UUIDs of all disks attached to a Linux system, the administrator can run the commandblkid(B). This will display the block device attributes, including the UUID, label, type, and partition information. The other commands are not related to this task.Reference:

[CompTIA Linux+ Study Guide], Chapter 5: Managing Filesystems and Logical Volumes, Section: Identifying Disks by UUID

[How to Use blkid Command in Linux]

Total 371 questions
Go to page: of 38