RHCSA Essential Command-Line Tools 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 Essential Command-Line Tools flashcards as text
What does the redirection operator '>>' do?
Answer: Appends stdout to a file without overwriting
>> appends standard output to the end of a file, preserving existing content.
Which command lists all environment variables currently set in the shell?
Answer: env
env without arguments prints all environment variables and their values to stdout.
When using 'find', what does '-mtime -2' mean?
Answer: Files modified within the last 2 days
In find, -mtime -2 selects files whose modification time is less than 2*24 hours ago (within the last 2 days).
What does 'chmod 755 script.sh' set on the file?
Answer: Owner: rwx, Group: r-x, Others: r-x
Octal 7=rwx, 5=r-x, so 755 gives the owner full permissions and group/others read+execute.
Which command creates a hard link named 'link1' pointing to 'file1'?
Answer: ln file1 link1
ln without -s creates a hard link; both names refer to the same inode on the same filesystem.
What is the effect of 'echo $?' after a command returns successfully?
Answer: Prints 0
$? holds the exit status of the most recently executed command; 0 indicates success.
Which command would archive and compress the directory '/data' into a gzip-compressed tarball named 'data.tar.gz'?
Answer: tar -czf data.tar.gz /data
tar -czf uses -c to create, -z for gzip compression, and -f to name the output file.