By Manny Fernandez

November 14, 2017

VI Cheat Sheet

VI Cheat Sheet

Here is a simple VI cheat sheet. I like β€˜vi’ because it is pretty much included by default in everything. Just like in my Cisco life, I have always used the CLI and not GUIs because sometimes, those GUIs don’t work or they are not present. This way you can always be ready for anything that comes your way.


Scrolling and Searching

Command Function
<ctrl>d Scroll down (half a screen)
<ctrl>u Scroll up (half a screen)
<ctrl>f Page forward
<ctrl>b Page backward
/string Search forward
?string Search backward
<ctrl>l Redraw screen
<ctrl>g Display current line number and file information
n Repeat search
N Repeat search reverse G Go to last line
nG Go to line n
:n Go to line n
z<CR> Reposition window: cursor at top
z. Reposition window: cursor in middle
z- Reposition window: cursor at bottom

Delete Commands

Command Function
dd or ndd Delete n lines to general buffer
dw Delete word to general buffer
dnw Delete n words
d) Delete to end of sentence
db Delete previous word
D Delete to end of line
x Delete character

Undo Commands
Command Function
u Undo last change
U Undo all changes made to the line

Copy / Paste

Command Function
v Select Charecters
V Select the entire Line
d Delete (AKA Cut)
y Yank (AKA Copy)
P Paste before the cursor
p Paste afer the cursor

Command-Line Archiving and Compression Tools: tar, zstd, xz, 7-Zip and More on Linux, macOS, Windows and BSD

Command-Line Archiving and Compression Tools: tar, zstd, xz, 7-Zip and More on Linux, macOS, Windows and BSD

Compare command line compression tools on Linux, macOS, Windows and BSD: tar, zstd, xz, 7-Zip and zip, with real benchmarks, flags and gotchas.

Read More
Netkit telnetd CVE-2026-141380: Find It, Kill It, and Fence It Off

Netkit telnetd CVE-2026-141380: Find It, Kill It, and Fence It Off

Netkit telnetd CVE-2026-141380 gives attackers pre-auth root on Debian, Ubuntu and Kali. Find exposed hosts, remove telnetd and block it on FortiGate.

Read More
ffmpeg Commands: 15 Common Use Cases for Real-World Video Work

ffmpeg Commands: 15 Common Use Cases for Real-World Video Work

Copy-paste ffmpeg commands for 15 common jobs: trim, compress, resize, normalize audio, crop for Shorts, make GIFs and strip GPS metadata.

Read More