Question 1
If you're trying to redirect stdout or stderr AND throw a long command that's been piped multiple times and includes multiple commands into the background, how do you need to do it?
Correct Answer:
(command; commands | commands) > /dev/null 2>&1 &
Explanation:
The key idea is to treat the whole multi-part command as a single job, so you can redirect both outputs for the entire block and run it in the background. Wrapping the entire sequence in a subshell and then redirecting and backgrounding that subshell ensures stdout and stderr from every part of the long command are sent to /dev/null, not just a piece of it. The syntax shown does exactly that: the long sequence (including an initial simple command followed by a pipeline) is grouped, then its stdout is redirected to /dev/null and 2>&1 sends stderr there as well, and finally the ampersand backgrounds the entire grouped job. This avoids partial redirection and guarantees the whole job runs quietly in the background. In contrast, options without proper grouping or with an incorrect redirection path would either fail to redirect both streams for all parts or would not reliably background the entire composite command.
Question 2
Where is the Linux kernel stored?
Correct Answer:
/boot
Explanation:
The kernel image and its boot files are kept in the /boot directory. This location holds the compressed kernel binary (like vmlinuz-) and related items such as the initial ramdisk (initramfs) and System.map, which the bootloader uses to start the system. The bootloader, for example GRUB, reads these files from /boot during startup and loads the kernel into memory. In contrast, /root is the root user’s home directory, /home stores regular users’ home directories, and /var contains variable data like logs and caches, none of which are where the kernel image resides.
Question 3
If a diff shows '2,4c2,4', what does this indicate about the change?
Correct Answer:
Replace lines 2-4 in the original with lines 2-4 from the new file
Explanation:
In diff notation, a change operation signals that a section of the original file is being replaced by content from the new file. The two ranges show which parts are involved: the portion from the original that will be replaced, and the portion from the new file that will replace it. So a change instruction means you take the specified block from the new file and substitute it for the corresponding block in the original. It is not an append or a simple delete, and there isn’t a separate copy operation here. This is why the interpretation is that the original segment is replaced by the new content.
Question 4
In the following sed command what is the g used for? sed 's/bob/jake/g'
Correct Answer:
It means that if there are more instances of 'bob' on one line, more than the first will be replaced; normally only the first 'bob' on each line would be replaced.
Explanation:
The g flag in a sed substitution enables global replacement. In the command sed 's/bob/jake/g', sed looks for every occurrence of bob on each input line and replaces all of them with jake. Without the g flag, only the first bob on each line would be replaced, leaving others unchanged. This flag operates per line, since sed processes input one line at a time. Other flags exist for different behaviors, but g specifically makes the substitution apply to all matches within a single line.
Question 5
To delete a file, what permissions do you need?
Correct Answer:
Write and execute for the directory
Explanation:
Deleting a file is a change to the directory’s contents, not a change to the file itself. To remove an entry, you must be able to modify the directory, which requires write permission on the directory. You also need execute permission on the directory to access or traverse it and reach the entry you want to delete. The file’s own permissions don’t control whether you can delete it. (Note: a sticky bit on a directory, common on shared dirs like /tmp, can restrict deletion of files owned by others even if you have write/execute on the directory.) So, the necessary permissions are write and execute on the directory.
Question 1
Exam overview

About this Exam

Prepare with the OSCP Linux Practice Exam practice quiz. This question bank includes 10 questions covering command, multiple, commands, need, and shows. Use it to review important concepts, identify knowledge gaps, and build confidence for the related exam, course, or assessment.

More details

Additional Information

OSCP Linux Practice Exam

This practice set contains 10 questions from the matching question bank and focuses on command, multiple, commands, need, and shows. Work through each question carefully, review the provided solutions, and revisit topics that need more study before your next attempt.

This is an independent study resource intended for practice and review; it is not an official examination or an endorsement by any organization named in the title.

Quiz information

Frequently Asked Questions

The complete question count is available after full access is unlocked.
No fixed duration is currently configured for this quiz.
Question explanations are included where they are available in the quiz content, helping you review the reasoning after answering.
Yes. You can retake the practice test again as you continue studying during your available access period.
After your access is confirmed, you can continue into the complete practice exam from this quiz flow.
Unless explicitly stated otherwise, this page provides independent practice material for study and exam preparation and is not the official examination itself.
Keep studying

Related Questions