Categories
All Categories
DMV
ServSafe
OSHA
NCLEX
HESI
TEAS
ATI Nursing
CNA & Nurse Aide
NREMT & EMS
ACLS
BLS
CPR
Quizzes
Study Guides
Flashcards
Packages
0
Log In
Register
Categories
All Categories
DMV
ServSafe
OSHA
NCLEX
HESI
TEAS
Quizzes
Study Guides
Flashcards
Packages
Contact
Cart
0
Log In
Register
OSCP Linux Practice Exam
Access More Questions
Report question problem
×
I think the answer is wrong
There are multiple correct answers
There is a typing error
Image or comprehension text is not display properly
Something else(please specify below)
Any more information
In the following sed command what is the g used for? sed 's/bob/jake/g'
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.
It disables global replacement
It applies replacement to the next line only
It makes the replacement case-insensitive
Reveal Answer
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.
Access more questions from this quiz
Continue to OSCP Linux Practice Exam for more practice questions and the full quiz experience.
Access More Questions