System Administration Scripting
LATEST MIDTERM GUIDE
Q&S
©2024/2025
,1. Multiple Choice: What is the primary function of a shell in
a Unix-like system?
a) Managing hardware resources
b) Providing an interface for system administration
scripting
c) Handling user authentication
d) Networking and data transfer
Answer: b) Providing an interface for system
administration scripting
Rationale: The shell is the command-line interface used
by the system administrator to control the operating system
and its processes.
2. Fill-in-the-Blank: In a scripting context, the _______
command is used to search for and replace text within files.
Answer: sed (Stream Editor)
Rationale: The sed command is a stream editor that can
perform basic text transformations on an input stream (a file
or input from a pipeline).
3. True/False: The cron daemon can be used to schedule
scripts to run at specific intervals.
Answer: True
Rationale: The cron daemon is used to execute
scheduled commands or scripts at specified times and
intervals.
4. Multiple Response: Which of the following are valid types
of shell variables? (Select all that apply)
a) Local variables
©2024/2025
, b) Environmental variables
c) System variables
d) User-defined variables
Answers: a) Local variables, b) Environmental variables,
d) User-defined variables
Rationale: Local, environmental, and user-defined
variables are all types of variables used in shell scripting.
System variables are not a recognized category.
5. Multiple Choice: What does the 'chmod +x' command do
to a file?
a) Changes the file ownership
b) Modifies the file's read permissions
c) Adds execute permissions to the file
d) Compresses the file
Answer: c) Adds execute permissions to the file
Rationale: The 'chmod +x' command modifies a file's
mode bits to add execute permissions for the user, group,
and others.
6. Fill-in-the-Blank: The _______ utility is used to monitor
and control processes on Unix-like systems.
Answer: top
Rationale: The top program provides a dynamic real-time
view of a running system, including process management.
7. True/False: Bash scripts must always have a '.sh' file
extension.
Answer: False
Rationale: While '.sh' is a common convention for bash
scripts, the file extension is not required for the script to run.
8. Multiple Response: Which of the following are benefits of
©2024/2025