Skip to main content
In this lesson, we’ll cover two essential terminal pagers—less and more—and then explore the Vim (VI Improved) text editor. You’ll learn how to view, search, and navigate text in the shell, as well as basic editing workflows in Vim.

Terminal Pagers

Pagers allow you to open large text files inside your shell session and move around without opening a full editor.

less: Feature-Rich File Viewer

The less pager is highly configurable and supports backward navigation, incremental search, and more. Open a file:
Navigation keys:
  • Up/Down arrows or j/k
  • Space to scroll forward one page
  • b to scroll back one page
Searching inside less:
  1. Press /
  2. Enter your search term (e.g., debug)
  3. Hit Enter
  4. Use n for next match and N for previous match
By default searches are case-sensitive. To ignore case, launch with -I:
Exit less:

more: Simple Pager for Quick Viewing

The more pager is straightforward and ideal for quick lookups. Open a file:
Basic navigation:
  • Space for the next page
  • Enter for the next line
Quit more:

Comparing less vs more


Vim (VI Improved) Editor

Vim is a powerful modal editor that’s ubiquitous on Linux systems. Understanding its modes is key to efficient editing.

Launching Vim

Start without a file (you’ll assign a name before saving):
Or open an existing/new file directly:

Vim Modes

  • Normal (default): Navigate & issue commands
  • Insert: Enter text
  • Command-line: Save, quit, or run Ex commands
Vim’s modal design separates navigation from text entry. Mastering mode transitions is the first step.

Entering Insert Mode

Press i to insert text. You’ll see -- INSERT -- at the bottom.
The image shows a terminal window with the Vim text editor open, displaying the text "This is our text for our vim demo." The editor is in insert mode.
Type content:
Press Esc to return to Normal mode.

Searching in Normal Mode

  1. Press /
  2. Type your search (e.g., is)
  3. Hit Enter
For case-insensitive matches, append \c:
The image shows a terminal window with a text editor open, displaying the sentence "This is our text for our vim demo." The word "This" is highlighted, and a search command is partially typed at the bottom.

Jump to a Specific Line

In Normal mode, type : plus the line number:

Yanking, Cutting & Pasting

Saving & Exiting

Switch to Command-line mode by typing : in Normal mode, then use:
  • :w — write (save)
  • :q — quit
  • :wq — write and quit
  • :q! — quit without saving
Using :q! will discard all unsaved changes. Be sure you intend to lose your edits before forcing a quit.

Example Workflow


Additional Resources

Watch Video