RHCSA Shell Scripting and Automation Flashcards
6 cards from real RHCSA practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 RHCSA Shell Scripting and Automation flashcards as text
Which cron field order is correct when defining a cron job?
Answer: minute hour day month weekday
The standard cron field order is: minute (0–59), hour (0–23), day of month (1–31), month (1–12), day of week (0–7).
What cron schedule expression runs a job every day at 2:30 AM?
Answer: 30 2 * * *
The expression `30 2 * * *` means minute=30, hour=2, any day, any month, any weekday — i.e., 2:30 AM daily.
Which command lists all cron jobs for the current user?
Answer: crontab -l
`crontab -l` lists the current user's scheduled cron jobs without opening an editor.
In a Bash `if` statement, which operator tests if two strings are equal?
Answer: ==
Inside `[[ ]]` or `[ ]`, the `==` operator performs string equality comparison in Bash.
What does the `read` command do in a Bash script?
Answer: Reads input from stdin into a variable
The `read` command reads a line from standard input and stores it in the specified variable name.
Which special variable in Bash holds the PID of the last background process?
Answer: $!
`$!` expands to the process ID of the most recently executed background pipeline or command.