Multiple choice technology operating systems

Which of these commands finds all lines on which the word "Linux" occurs and then deletes them in vi editor

  1. g:Linux/d

  2. :g/Linux/d

  3. g/d/Linux

  4. Linux/:g/d

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The vi command :g/Linux/d uses the global command (g) to find all lines containing "Linux" and the delete command (d) to remove them. The syntax is :g/pattern/command, where pattern is a regular expression and command operates on each matching line.