Multiple choice technology operating systems

How can you display the line numbers after opening a file in vi ?

  1. :se ic

  2. :se nu

  3. :set G

  4. ctrl+n

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

In vi, the command :se nu (short for 'set number') displays line numbers in the editor. Option A's 'ic' stands for 'ignore case' which affects searching behavior, not display. Option D 'ctrl+n' is used for auto-completion in insert mode, not for toggling line numbers.

AI explanation

In vi/vim, the :set number command (abbreviated :se nu) toggles absolute line numbers in the left margin. :se ic sets ignorecase for searches, which is unrelated, and :set G and ctrl+n aren't valid ways to enable numbering (G alone just moves to end of file in command mode). So :se nu is the correct way to show line numbers.