nerdexam
Oracle

1Z0-409 · Question #215

You have opened file1 in the vi editor. The contents of file1 is shown below: [root@server1 ~]# vi file1 green red pink blue green pink white green blue green blue green pink green At the vi editor…

The correct answer is B. It will search the entire file for the first occurrence of the regex green and replace it with the word. See the full explanation below for the reasoning.

Question

You have opened file1 in the vi editor. The contents of file1 is shown below:

[root@server1 ~]# vi file1 green red pink blue green pink white green blue green blue green pink green At the vi editor command mode, you execute the following command to edit the contents of file 1:

:1,$s/green/yellow/ What will be the result of this command?

Options

  • AIt will search only the first line for all occurrences of the regex green and replace it with the word
  • BIt will search the entire file for the first occurrence of the regex green and replace it with the word
  • CIt will search only the first line for the first occurrence of the regex green and replace it with the
  • DIt will search the entire file for all occurrences of the regular expression (regex) green and replace

How the community answered

(38 responses)
  • A
    5% (2)
  • B
    79% (30)
  • C
    13% (5)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-409 Practice