Title: Vi Commands - Miscellaneous (report, join and search)
Course: CIS 121: Linux/UNIX I: Fundamentals ~ For IGNITE Review > Section: Learning Modules

When in command mode, pressing J will append the next line to the current line. Also, typing /, while in command mode, will allow you to search in vi for strings (can be a regular expression). Typing /foo will do a forward search for the string foo and typing ?bar will do a backward search for bar. (Source: Linux Fundamentals, Cobbaut, 149)

- <ctrl>g – Report position and status
- J – Join following line to end of current line
- / - search forward (uses reg ex)
- ? - search backward (uses reg ex)
- . - Repeat last text changing command

Remember, many commands will repeat if proceeded by a number.

Vi Command Illustration (J k j u)

Click the command buttons to move up and down (k and j) in the file and to join (J) lines. The undo command (u) will undo the last join.