RHCSA Linux Essentials Flashcards
7 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 7 RHCSA Linux Essentials flashcards as text
Which command searches for the string 'error' case-insensitively in all .log files under /var/log?
Answer: grep -ri 'error' /var/log/
`grep -r` recurses through directories and `-i` makes the search case-insensitive, covering all .log files.
What does the `tar -xzf archive.tar.gz -C /opt/` command do?
Answer: Extracts archive.tar.gz into the /opt/ directory
The flags -x (extract), -z (gzip), -f (file) combined with -C specify the extraction destination directory.
Which command sets a user account to expire on December 31, 2026?
Answer: Both B and C are correct
Both `usermod -e` and `chage -E` accept a YYYY-MM-DD date and set the account expiration date.
A volume group `vg_data` has 10 GiB free. Which command creates a 4 GiB logical volume named `lv_logs`?
Answer: lvcreate -L 4G -n lv_logs vg_data
`lvcreate -L 4G -n lv_logs vg_data` creates a new 4 GiB logical volume named lv_logs in the specified volume group.
Which configuration file defines the DNS search domain and nameservers for a RHEL system?
Answer: /etc/resolv.conf
/etc/resolv.conf contains the `nameserver` and `search` directives used by the resolver library.
What is the correct way to redirect both stdout and stderr to a file named output.txt?
Answer: command &> output.txt
`&>` is bash shorthand that redirects both file descriptor 1 (stdout) and 2 (stderr) to the same file.
Which command would display the last 50 lines of the journal for the sshd service?
Answer: journalctl -u sshd -n 50
`journalctl -u sshd -n 50` filters journal entries for the sshd unit and limits output to the last 50 lines.