$
Lernen Linux-Handbuch
de
XP:0
Quest 96Vim-Virtuoso
+250 XP

Vim Navigation, Deleting & Searching (dd, yy, p, /)

Interaktives Terminal für diese Quest starten→Keine Installation erforderlich • Läuft im Browser

Konzept & Übersicht

Once you master Normal mode commands, Vim allows lightning-fast text manipulation without touching a mouse:

- dd: Delete (cut) the entire current line into the yank buffer.
- yy: Yank (copy) the current line.
- p: Paste the yank buffer on the line below the cursor.
- /pattern: Search forward through the file for text matching pattern.
- :%s/old/new/g: Global search and replace throughout the entire file without manual edits.

Open server.conf with vim server.conf. Search for the word port by typing /port. Substitute all occurrences of 99999 with 8080 using :%s/99999/8080/g. Delete any unneeded line using dd, and then save and quit with :wq.

Befehlssyntax-Referenz

Command / SyntaxDescription
/portSearch for text pattern in Vim
:%s/99999/8080/gSearch and replace throughout file in Vim
ddDelete (cut) current line in Vim
:wqSave and exit Vim

Prüfungsziele

  • ○
    Search for pattern using "/port"
  • ○
    Replace port using ":%s/99999/8080/g"
  • ○
    Delete line with "dd"
  • ○
    Save modified file with ":wq"

Bereit für Quest 96?