Question 180
A file has two hard links and one pathname is deleted. What normally happens to the underlying data?
- Symbolic linkage rather than hard linkage
- The inode remains while another hard link exists
- readlink symlink
- ln -s /opt/app/config.yml /etc/app-link.yml
- ln original hardcopy
Explanation
Correct Answer
B:Unlinking one name reduces the link count, but data remains accessible through surviving names and open references. Removing one hard link does not truncate the other.
Incorrect Answers
A:Symlinks can refer across filesystem boundaries because their contents are paths; that changes a different part of the system; the requested outcome is preserving inode data after one name is removed.
C:readlink displays the link target recorded in the symbolic-link inode; it will not provide preserving inode data after one name is removed under these conditions.
D:A symbolic link stores a pathname and can cross filesystem boundaries; using it would leave preserving inode data after one name is removed unresolved.
E:A hard link adds another directory entry referencing the same inode and data; the requirement is preserving inode data after one name is removed, outside the effect of this choice.
Question 181
A target folder is empty and should be removed only if that condition is true. Which command enforces it?
- rmdir /srv/empty
- mv old.csv new.csv
- find /srv -type f -mtime -1
- file sample.dat
Explanation
Correct Answer
A:rmdir removes empty directories and fails when entries remain. That behavior is safer than recursively deleting a populated tree.
Incorrect Answers
B:mv renames or relocates files and can use a filesystem rename when source and target are on the same filesystem; the evidence calls for deleting a directory only when empty, not merely this separate operation.
C:find walks a directory tree and evaluates predicates for file type and modification time; the task involves deleting a directory only when empty, whereas this addresses another subsystem.
D:file examines signatures and other content characteristics to identify probable formats; its scope differs from deleting a directory only when empty, so it cannot meet the stated requirement.
Question 182
A text file needs an updated modification timestamp without editing its contents. Which utility works?
- ls -ld /srv/data
- rmdir /srv/empty
- mv old.csv new.csv
- touch -m report.txt
- stat /srv/file
- mkdir -p /srv/app/cache
Explanation
Correct Answer
D:touch can update specified timestamps without modifying file data. The -m selection targets modification time rather than access time.
Incorrect Answers
A:ls -ld displays long-format metadata about the directory entry; the administrator instead needs updating a file's modification timestamp; this option serves a different purpose.
B:rmdir removes empty directories and fails when entries remain; it answers a neighboring question rather than updating a file's modification timestamp.
C:mv renames or relocates files and can use a filesystem rename when source and target are on the same filesystem; that changes a different part of the system; the requested outcome is updating a file's modification timestamp.
E:stat reports inode, permissions, sizes, and multiple file timestamps; it will not provide updating a file's modification timestamp under these conditions.
F:mkdir -p creates missing parent directories and does not fail merely because an existing directory is already present; using it would leave updating a file's modification timestamp unresolved.
Question 183
An engineer needs to see the permissions and ownership of a directory itself instead of its contents. Which command fits?
- ls -ld /srv/data
- touch -m report.txt
- mv old.csv new.csv
- cp -a source/ destination/
Explanation
Correct Answer
A:ls -ld displays long-format metadata about the directory entry. Without -d, ls normally lists entries inside the directory.
Incorrect Answers
B:touch can update specified timestamps without modifying file data; the requirement is inspecting attributes of the directory inode, outside the effect of this choice.
C:mv renames or relocates files and can use a filesystem rename when source and target are on the same filesystem; it does not deliver inspecting attributes of the directory inode, which is decisive in this scenario.
D:cp -a performs an archive-style recursive copy while preserving many attributes; the evidence calls for inspecting attributes of the directory inode, not merely this separate operation.
Question 184
The administrator wants to identify an unknown downloaded file by its contents rather than its extension. Which utility is appropriate?
- ls -ld /srv/data
- file sample.dat
- mv old.csv new.csv
- cp -a source/ destination/
Explanation
Correct Answer
B:file examines signatures and other content characteristics to identify probable formats. A filename extension alone is not always trustworthy.
Incorrect Answers
A:ls -ld displays long-format metadata about the directory entry; its scope differs from identifying file format using content signatures, so it cannot meet the stated requirement.
C:mv renames or relocates files and can use a filesystem rename when source and target are on the same filesystem; the administrator instead needs identifying file format using content signatures; this option serves a different purpose.
D:cp -a performs an archive-style recursive copy while preserving many attributes; it answers a neighboring question rather than identifying file format using content signatures.
Question 185
An operations account requires a noninteractive service identity without a normal login session. Which creation approach is suitable?
- usermod -aG docker sam
- useradd -m -d /home/deploy deploy
- useradd -r -s /usr/sbin/nologin svcapp
- useradd -u 2205 account
Explanation
Correct Answer
C:A system-style account combined with a non-login shell helps isolate service execution. Exact system UID ranges and shell path vary by distribution.
Incorrect Answers
A:The -aG combination appends a supplemental group to the user's existing list; this does not achieve creating a service identity without interactive login on the system described.
B:useradd creates the account, while -m requests creation of its home and -d selects the path; it will not provide creating a service identity without interactive login under these conditions.
D:The -u argument chooses the new account's numeric UID, provided it is valid and available; the requirement is creating a service identity without interactive login, outside the effect of this choice.
Question 186
A temporary account must cease being valid after a specified date. Which command configures account expiration?
- chage -d 0 sam
- userdel -r formeruser
- usermod -d /home/new -m sam
- usermod -e 2026-12-31 tempuser
Explanation
Correct Answer
D:usermod -e sets the account's expiration date in the local account database. It is distinct from password aging.
Incorrect Answers
A:chage -d 0 marks the password as requiring change at next password-based login; the evidence calls for setting a fixed account expiration date, not merely this separate operation.
B:userdel -r removes the account and associated home and mail spool when supported; the task involves setting a fixed account expiration date, whereas this addresses another subsystem.
C:usermod -d changes the recorded home location and -m moves content when supported; its scope differs from setting a fixed account expiration date, so it cannot meet the stated requirement.
Question 187
An account needs a supplementary membership in the existing docker group without dropping current memberships. Which command is correct?
- usermod -aG docker sam
- groupadd auditors
- useradd -r -s /usr/sbin/nologin svcapp
- groupadd -g 4500 media
- useradd -m -d /home/deploy deploy
Explanation
Correct Answer
A:The -aG combination appends a supplemental group to the user's existing list. Omitting -a can replace previously assigned supplementary groups.
Incorrect Answers
B:groupadd registers a local group in the system account database; that changes a different part of the system; the requested outcome is appending supplementary group membership safely.
C:A system-style account combined with a non-login shell helps isolate service execution; this does not achieve appending supplementary group membership safely on the system described.
D:groupadd -g sets a particular local group ID if it is not already used, unless explicit nonunique behavior is allowed; it will not provide appending supplementary group membership safely under these conditions.
E:useradd creates the account, while -m requests creation of its home and -d selects the path; using it would leave appending supplementary group membership safely unresolved.
Question 188
A terminated worker's account and home directory should both be removed after retention requirements are met. Which command requests both?
- userdel -r formeruser
- chage -d 0 sam
- usermod -e 2026-12-31 tempuser
- groupmod -n platform devops
Explanation
Correct Answer
A:userdel -r removes the account and associated home and mail spool when supported. Other files owned by the UID elsewhere may still require review.
Incorrect Answers
B:chage -d 0 marks the password as requiring change at next password-based login; it does not deliver removing an account together with its home, which is decisive in this scenario.
C:usermod -e sets the account's expiration date in the local account database; the evidence calls for removing an account together with its home, not merely this separate operation.
D:groupmod -n changes the local group name while preserving its identity number; the task involves removing an account together with its home, whereas this addresses another subsystem.
Question 189
A security reviewer needs the most recent successful login recorded for each account. Which utility typically summarizes that?
- whoami
- getent passwd appuser
- lastlog
- id
Explanation
Correct Answer
C:lastlog reads last-login accounting records for users. Its output depends on the distribution's login database availability.
Incorrect Answers
A:whoami outputs the name corresponding to the effective user ID; that is not equivalent to reviewing last successful login information.
B:getent consults configured Name Service Switch backends, including remote directories where configured; the administrator instead needs reviewing last successful login information; this option serves a different purpose.
D:id shows real and effective user/group IDs and group membership; that changes a different part of the system; the requested outcome is reviewing last successful login information.
Question 190
A group previously named devops must be renamed without changing its numeric GID. Which utility supports this?
- usermod -e 2026-12-31 tempuser
- groupmod -n platform devops
- usermod -d /home/new -m sam
- chage -d 0 sam
Explanation
Correct Answer
B:groupmod -n changes the local group name while preserving its identity number. Existing filesystem permissions normally continue using the same GID.
Incorrect Answers
A:usermod -e sets the account's expiration date in the local account database; it will not provide changing a local group name under these conditions.
C:usermod -d changes the recorded home location and -m moves content when supported; the requirement is changing a local group name, outside the effect of this choice.
D:chage -d 0 marks the password as requiring change at next password-based login; it does not deliver changing a local group name, which is decisive in this scenario.