How to Use the glow Command in Linux Terminal to Render and Read Markdown Files

Markdown has become the ubiquitous standard for documentation, repository READMEs, and technical notes across the software development industry. However, reading raw Markdown files directly inside standard Linux terminal pagers like cat or less displays unparsed syntax hashes, brackets, and raw table dividers that strain readability. glow is a terminal-based Markdown reader developed by Charm that renders formatted headings, coloured syntax-highlighted code blocks, tables, and hyperlinks directly in the CLI.

Key Capabilities of glow

Built with Charm’s terminal rendering libraries, glow enhances the command-line documentation experience:

  • Formatted CLI Styling: Converts Markdown typography into clean terminal representations, complete with bold headers, styled bullet points, and neat indentation.
  • Syntax Highlighting: Automatically formats fenced code blocks in Python, JavaScript, Go, Bash, and other programming languages with tailored terminal colour schemes.
  • Table Rendering: Aligns complex ASCII markdown tables into cleanly proportioned boxes with borders that adjust to terminal dimensions.
  • Interactive TUI Paging: Features an integrated full-screen terminal user interface (TUI) with keyboard navigation, scrolling, and stash management.
  • Remote URL Rendering: Reads raw Markdown directly from online URLs, such as GitHub repositories or documentation sites, without requiring manual downloads.

Installing glow Across Popular Linux Distributions

The glow binary is available across diverse packaging systems:

  • Ubuntu, Debian, and Derivatives:
    sudo mkdir -p /etc/apt/keyrings
    curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
    echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
    sudo apt update && sudo apt install glow
  • Fedora and Red Hat Enterprise Linux:
    sudo dnf install glow
  • Arch Linux and Manjaro:
    sudo pacman -S glow
  • Homebrew for Linux:
    brew install glow
  • Snap Package:
    sudo snap install glow

Common Usage Patterns and Everyday Commands

Using glow ranges from quick file inspections to interactive library browsing:

1. Rendering a Local Markdown File

To render a formatted Markdown file directly to your terminal standard output:

glow README.md

If the document is lengthy and exceeds your window height, pipe into the pager or use the -p flag to enable native scrolling:

glow -p README.md

2. Launching the Interactive TUI Browser

Run glow without specifying any file argument to open the full interactive explorer:

glow

This launches an interactive dashboard that discovers all Markdown files located within your current directory and subfolders. Use the arrow keys or j/k to navigate files, press Enter to read, and press Esc or q to return.

3. Reading Remote Markdown Files Directly

You can render Markdown files directly from public web addresses without downloading them first:

glow https://raw.githubusercontent.com/charmbracelet/glow/master/README.md

4. Changing Colour Themes and Output Width

Customise visual styles to match your terminal aesthetic:

  • Select Dark or Light Styles: Run glow -s dark README.md or glow -s light README.md to calibrate contrast against your terminal background.
  • Constrain Text Width: By default, glow wraps text gracefully to 80 columns. You can specify a custom wrap boundary using glow -w 100 README.md.

Integrating glow with Git and Shell Workflows

To make reading repository documentation effortless, create a custom shell alias in your ~/.bashrc or ~/.zshrc:

alias readme="glow -p README.md"

Typing readme inside any newly cloned Git repository instantly loads a syntax-highlighted, interactive document reader, accelerating code review and onboarding.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.