JN0-106 Junos Configuration Basics Practice Question
An administrator needs to change a portion of the configuration by matching a pattern and replacing it with new text. Which Junos configuration mode command should be used?
⚠ Common exam trap
Many candidates confuse 'replace pattern' with 'set replace pattern' (which does not exist) or assume 'rename' can perform pattern-based substitution, leading them to select an incorrect option due to familiarity with similar commands in other vendors' syntax.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
replace pattern
The 'replace pattern' command in Junos configuration mode allows an administrator to search for a specific text pattern using regular expressions and replace it with new text. This is the correct command for pattern-based substitution within the configuration hierarchy, as it directly matches and replaces text without requiring manual deletion or re-entry.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
rename
Why it's wrong here
The rename command in Junos changes the identifier of a configuration node (e.g., interface name, policy name) but does not perform textual pattern substitution. It operates on the hierarchical element name, not on arbitrary text within the configuration. For replacing a specific string within a configuration snippet, the replace pattern operation is required.
- ✓
replace pattern
Why this is correct
The replace pattern command in Junos configuration mode uses a Perl-like regular expression to search for a pattern and replace it with specified text in a configuration statement or hierarchy. It is the appropriate way to alter a portion of the configuration that may recur, such as changing an IP address or hostname across multiple sections. The syntax is `replace pattern <pattern> with <replacement>` (with optional before/after context).
- ✗
copy
Why it's wrong here
The copy command duplicates an existing configuration object (e.g., an interface, a policy) to a new name, creating a replica rather than modifying the original text. It does not search-and-replace text within the configuration, so it cannot be used to change a portion of an existing configuration block. The copy operation is for creating new configuration stanzas based on existing ones.
- ✗
set replace pattern
Why it's wrong here
This is an invalid command in Junos. The correct replace operation is issued directly as `replace pattern ...`, not as a `set` command. The `set` command is for adding or modifying configuration values, not for pattern substitution. Attempting to use `set replace pattern` will result in an error, as Junos CLI does not recognize that combined syntax.
About these practice questions
This JN0-106 question is part of Courseiva's 326-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This JN0-106 practice question is part of Courseiva's free Juniper Networks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the JN0-106 exam.