RHCSA EX200 Practice: Seven Original Shell Tasks With Checks
Prepare for EX200 through original tasks that build the published skills, using the current Red Hat objectives as the scope reference. This exercise practises seven bounded files-and-shell tasks: creating a workspace, setting permissions, filtering text, archiving, restoring, comparing files and checking a function argument. The complete solution was executed in the available Linux shell with the expected output.
Topic: Red Hat & RHEL in IT Infrastructure · Certification preparation
Quick answer: Prepare for EX200 through original tasks that build the published skills, using the current Red Hat objectives as the scope reference. This exercise practises seven bounded files-and-shell tasks: creating a workspace, setting permissions, filtering text, archiving, restoring, comparing files and checking a function argument. The complete solution was executed in the available Linux shell with the expected output. It is foundational practice, with RHEL-specific services, storage, security and persistence requiring separate work in a suitable lab. No confidential exam questions or pass guarantee are provided.
Key takeaways
- Use original exercises and the published objectives for preparation.
- Predict each task’s result before reading the combined solution.
- Restore an archive and check the result as part of backup practice.
- Handle an expected argument error deliberately.
- Keep this shell check separate from full RHEL exam preparation.
Table of Contents
- Task 1: How do you create a workspace without changing system files?
- Task 2: How do you make the training log private?
- Task 3: How do you select the exact retry line?
- Task 4: How do you create an archive of the reports directory?
- Task 5: How do you restore without overwriting the original?
- Task 6: How do you check the restored file’s content?
- Task 7: How do you handle a missing argument and run the full solution?
- References
Task 1: How do you create a workspace without changing system files?
Work in a new temporary directory that contains only the exercise's invented data. The full solution uses mktemp and changes into that directory before writing files. Its initial permission mask restricts access for newly created training content. Read the directory setup before running the block.
Red Hat’s current EX200 objectives include essential tools and simple scripts on RHEL 10. These original tasks cover only a portion of that scope. They are not recalled questions or a claim about the exam's exact task layout. First write down where your files will be created and which existing files, if any, the solution could affect. In this exercise, all created items remain in its new temporary workspace.
Task 2: How do you make the training log private?
Create the reports directory and supplied log, then set the log mode to600. The intended ordinary permission bits give the owner read and write access while giving group and other users no access through those bits. Inspect the result instead of assuming the command changed what you intended.
GNU Coreutils documentation explains file and permission utilities. The checked solution reports the numeric mode using the tested utility. This is a small mode-bit exercise, not a complete evaluation of access under ACLs, privileged identities or every storage context. In a later multi-user lab, test the intended access using supplied identities. Keep that broader test separate from the numeric mode shown here.
| Task | Expected check in this fixture |
|---|---|
| 1: Workspace | A new temporary location contains the invented files |
| 2: Permissions | The log’s numeric mode prints 600 |
| 3: Text selection | Only status=retry is selected |
Task 3: How do you select the exact retry line?
The supplied log contains status=ok and status=retry. Select the whole retry line using anchors around the expression. The expected selected output is exactly status=retry. Explain why a loose substring search could answer a different question on a larger log.
The GNU Grep manual describes line selection and exit status. A no-match result is distinct from an execution error, so scripts need to handle the intended condition deliberately. Here the known fixture includes a matching line. The solution uses a small fixed pattern; it is not a general parser for arbitrary logs or user-controlled regular expressions. Keep the interpretation bounded to the invented two-line input.
Task 4: How do you create an archive of the reports directory?
Create reports.tar from the reports directory while the archive itself remains outside that directory. This avoids including the output archive within the source tree. Use a relative member path so the exercise can be restored within another training directory.
GNU tar documentation describes archive creation and extraction. In this fixture, the source is tiny and known. Do not apply a demonstration command to an unknown directory tree or extract an untrusted archive over important files. The task's first check is only that archive creation completed. The next tasks perform a restore and a comparison because the existence of an archive file alone does not establish that the needed content can be recovered.
Task 5: How do you restore without overwriting the original?
Create a fresh restored directory inside the workspace, then extract the training archive there. The result should be a separate reports/status.log beneath that restore directory. Keep the original available so it can be compared with the restored content.
RHEL documentation supplies the product context for broader administration and recovery practice. This fixture does not test a complete system backup, ownership restoration across users or disaster recovery. It teaches a bounded restore workflow you can inspect. Before a real restore, the authorised procedure needs to identify the destination, expected data, permissions and business requirements. A training workspace lets you learn that separation without overwriting your source.
| Task | Expected result or limitation |
|---|---|
| 4: Archive | Creation completes for the supplied reports directory |
| 5: Restore | Extraction targets a fresh directory, preserving the original |
| 6: Compare | cmp reports no byte difference for the two selected files |
| 7: Arguments | The missing-argument case returns through the intended branch |
Task 6: How do you check the restored file’s content?
Compare the original log with the restored log. The solution prints “restored bytes match” only after the comparison succeeds. This check concerns those two files' content; it does not establish that every attribute or every possible backup item is preserved.
Record the check alongside the restore step. If it fails, stop and inspect the source, archive and destination choices before changing the original. A useful extension in a separate fresh fixture is to alter the restored content and observe a comparison failure. Keep expected differences separate from utility errors when adding automation. The same discipline matters in larger administrative tasks: write what you checked and avoid claiming a broader result than that check supports.
Task 7: How do you handle a missing argument and run the full solution?
The check_file function expects one path. It reports usage and returns a distinct status when no argument is supplied. The caller invokes that case inside an if statement and records that it was handled. The Bash manual explains positional parameters and shell functions. Use Red Hat’s candidate policies for exam conduct; keep preparation to original or authorised material.
The exact full solution below passed in the available Linux /bin/sh with BusyBox utilities. It changes no system configuration and deletes nothing. It does not validate the complete RHEL 10 platform or the whole EX200 objective set.
set -eu
lab=$(mktemp -d /tmp/webasha-skills.XXXXXX)
cd "$lab"
umask 077
mkdir reports
printf 'status=ok\nstatus=retry\n' > reports/status.log
chmod 600 reports/status.log
printf 'mode=%s\n' "$(stat -c '%a' reports/status.log)"
printf 'selected line:\n'
grep '^status=retry$' reports/status.log
tar -cf reports.tar reports
printf 'archive created\n'
mkdir restored
tar -xf reports.tar -C restored
cmp reports/status.log restored/reports/status.log
printf 'restored bytes match\n'
check_file() {
if [ "$#" -ne 1 ]; then
printf 'usage: check_file PATH\n'
return 2
fi
if [ -f "$1" ]; then
printf 'file found\n'
else
printf 'file missing\n'
return 1
fi
}
check_file reports/status.log
if check_file; then
printf 'unexpected success\n'
else
printf 'missing argument handled\n'
fiExpected lines are mode=600, selected line:, status=retry, archive created, restored bytes match, file found, usage: check_file PATH and missing argument handled.
Related reading: check RHCSA training arrangements; start with a smaller path exercise.
If you want instructor feedback, ask WebAsha for a syllabus, supervised lab arrangements and written access terms before enrolling.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0