REDHAT RHCSA EX200
PRACTICE TEST
COMPLETE
Question 1: Which redirection operator appends standard output to an existing le without overwriting its current contents?
Choices:
1) > 2) >> 3) 2> 4) |
Correct Answer: >>
Explanation: The >> operator appends standard output to a le. A single > truncates or creates the destination le, 2> redirects standard error, and | sends output to another command.Page 1
Question 2: You need to nd every line in /etc/ssh/sshd_cong that begins with the word Permit, ignoring lines where Permit appears later in the line. Which command is most appropriate?
Choices:
1) grep 'Permit' /etc/ssh/sshd_cong 2) grep '^Permit' /etc/ssh/sshd_cong 3) grep 'Permit$' /etc/ssh/sshd_cong 4) grep -v '^Permit' /etc/ssh/sshd_cong
Correct Answer: grep '^Permit' /etc/ssh/sshd_cong
Explanation: The caret anchors the regular expression to the start of the line, so ^Permit matches lines whose rst characters are Permit.
Question 3: Which command creates a gzip-compressed tar archive named etc-
backup.tar.gz from the /etc directory?
Choices:
1) tar -czf etc-backup.tar.gz /etc 2) tar -xzf etc-backup.tar.gz /etc 3) gzip -r etc-backup.tar.gz /etc 4) tar -cjf etc-backup.tar.gz /etc
Correct Answer: tar -czf etc-backup.tar.gz /etc
Explanation: tar -c creates an archive, -z applies gzip compression, and -f species the archive lename. -x extracts, while -j selects bzip2 rather than gzip.Page 2
Question 4: A le named report has permissions -rw-r----- and is owned by
alice:nance. Which users can read the le?
Choices:
1) Only alice 2) Alice and members of nance 3) Members of nance only 4) All local users
Correct Answer: Alice and members of nance
Explanation: The owner has rw-, the group has r--, and others have ---. Therefore alice and users who receive the nance group permissions can read the le.
Question 5: Which command creates a symbolic link named /opt/current that
points to /opt/releases/v3?
Choices:
1) ln /opt/releases/v3 /opt/current 2) ln -s /opt/releases/v3 /opt/current 3) link -h /opt/releases/v3 /opt/current 4) cp -l /opt/releases/v3 /opt/current
Correct Answer: ln -s /opt/releases/v3 /opt/current
Explanation: ln -s creates a symbolic link. Without -s, ln creates a hard link when the source type and lesystem permit it.Page 3