Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

OSCP LINUX REFRESHER EXAM QUESTIONS AND CORRECT DETAILED ANSWERS LATEST UPDATE 2025 ALREADY GRADED A+ PROFESSOR VERIFIED

Rating
-
Sold
-
Pages
28
Grade
A+
Uploaded on
31-05-2025
Written in
2024/2025

What does the following do? ((i1?++i:--i)). Answer: It says that if i is less than 1, to add 1 to i, else subtract 1 from i. It effectively works like a toggle switch Can you use regex as your identifier in a case statement?. Answer: Nope. case statements use globs (which I believe are like parameter expansions), not regex. What do these assignment operators do? a = 5 a += 5 a -= 5 a *= 5 a /= 5 a %= 5 a++ a-- ++a --a. Answer: sets a equal to 5 sets a equal to a + 5 sets a equal to a - 5 sets a equal to a * 5 sets a equal to a integer divided by 5 sets a equal to a modulus divided by 5 sets a equal to a + 1. If you echo with echo $((a++)) then it will echo a before the addition, and THEN add the 1 to a sets a equal to a - 1. If you echo with echo $((a--)) then it will echo a before the subtraction sets a equal to a + 1. If you echo with echo $((++a)) then it will echo a after the addition sets a equal to a - 1. If you echo with ecoh $((--a)) then it will echo a after the subtraction Where does the & symbol go when redirecting output?. Answer: It always goes before the # Create an array with "a dog", "a cat", and "a fish" as elements. Then print out just the second element ("a cat"). Then print out each element separately using one catchall command. Then add on "a cow" and "a duck" to the end of the array. Now show them all again like you did before. Now list the number of elements and what each element is.. Answer: [ mjollnerd@gazelle: ~ ] $ animals=("a dog" "a cat" "a fish") [ mjollnerd@gazelle: ~ ] $ echo ${animals[1]} a cat [ mjollnerd@gazelle: ~ ] $ for i in "${animals[@]}"; do echo $i; done a dog a cat a fish [ mjollnerd@gazelle: ~ ] $ animals+=("a cow" "a duck") [ mjollnerd@gazelle: ~ ] $ for i in "${animals[@]}"; do echo $i; done a dog a cat a fish a cow a duck [ mjollnerd@gazelle: ~ ] $ echo ${#animals[@]} 5 If you're looking for a man page for something, but nothing is showing up (such as read), what do you do?. Answer: help

Show more Read less
Institution
OSCP - Offensive Security Certified Professional
Course
OSCP - Offensive Security Certified Professional

Content preview

OSCP LINUX REFRESHER EXAM QUESTIONS AND
CORRECT DETAILED ANSWERS LATEST UPDATE 2025
ALREADY GRADED A+ PROFESSOR VERIFIED.




✅What does the following do?



((i<1?++i:--i)). Answer: It says that if i is less than 1, to add 1 to i, else subtract 1 from i. It
effectively works like a toggle switch



✅Can you use regex as your identifier in a case statement?. Answer: Nope. case statements
use globs (which I believe are like parameter expansions), not regex.



✅What do these assignment operators do?



a=5

a += 5

a -= 5

a *= 5

a /= 5

a %= 5

a++

a--

++a

--a. Answer: sets a equal to 5

sets a equal to a + 5

sets a equal to a - 5

sets a equal to a * 5

,sets a equal to a integer divided by 5

sets a equal to a modulus divided by 5

sets a equal to a + 1. If you echo with echo $((a++)) then it will echo a before the addition,
and THEN add the 1 to a

sets a equal to a - 1. If you echo with echo $((a--)) then it will echo a before the subtraction

sets a equal to a + 1. If you echo with echo $((++a)) then it will echo a after the addition

sets a equal to a - 1. If you echo with ecoh $((--a)) then it will echo a after the subtraction



✅Where does the & symbol go when redirecting output?. Answer: It always goes before the
#



✅Create an array with "a dog", "a cat", and "a fish" as elements. Then print out just the
second element ("a cat"). Then print out each element separately using one catchall
command. Then add on "a cow" and "a duck" to the end of the array. Now show them all
again like you did before. Now list the number of elements and what each element is..
Answer: [ mjollnerd@gazelle: ~ ] $> animals=("a dog" "a cat" "a fish")

[ mjollnerd@gazelle: ~ ] $> echo ${animals[1]}

a cat

[ mjollnerd@gazelle: ~ ] $> for i in "${animals[@]}"; do echo $i; done

a dog

a cat

a fish

[ mjollnerd@gazelle: ~ ] $> animals+=("a cow" "a duck")

[ mjollnerd@gazelle: ~ ] $> for i in "${animals[@]}"; do echo $i; done

a dog

a cat

a fish

a cow

a duck

[ mjollnerd@gazelle: ~ ] $> echo ${#animals[@]}

5

, ✅If you're looking for a man page for something, but nothing is showing up (such as read),
what do you do?. Answer: help command



So in this example:

help read



✅What does the "shift" command do?. Answer: It assigns the value of $2 to $1 and then
unsets $2.



✅What does the following do?



while read i; echo $i; done < file.txt. Answer: It creates a variable "i" for each line in "file.txt"
and then echoes them one at a time.



✅What does do the following do?



$@

$$

$!. Answer: prints out all command arguments. Useful for creating a for loop.



prints out the PID of the currently running shell script.



prints out the PID of the last background process entered.



✅How would you create defaults into your read?



For example, if you wanted to prompt a user with "What is your name? [bob] " How would
you do it so that if they press enter, bob is stored as the answer?. Answer: echo "What is your
name? [$(whoami)] "

read myname

Written for

Institution
OSCP - Offensive Security Certified Professional
Course
OSCP - Offensive Security Certified Professional

Document information

Uploaded on
May 31, 2025
Number of pages
28
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$11.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TopGradeInsider Harvard University
View profile
Follow You need to be logged in order to follow users or courses
Sold
109
Member since
1 year
Number of followers
2
Documents
44012
Last sold
4 days ago
TopGradeInsider

Welcome to TopGradeInsider, your ultimate partner in navigating academic life. We know the pressure you’re under, which is why we’ve curated a massive library of high-quality resources designed to make your life easier. Access reliable test banks, solution manuals, and study guides that clarify complex topics and save you valuable time. Don’t let stress get in the way of your degree let TopGradeInsider give you the support you need to finish strong.

Read more Read less
4.3

8 reviews

5
3
4
4
3
1
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions