Yes, you can display Markdown files nicely in a Linux terminal! While the terminal itself doesn’t natively render Markdown (with formatting like bold, italics, headers, etc.), there are several tools that can help you view Markdown with formatting (like colors, bold, headings, etc.) right in your terminal.
Here are some popular options:
1. glow (Recommended)
Description: A modern CLI tool that renders Markdown with colors and formatting in your terminal.
Description: Renders Markdown in the terminal, with support for colors and even images in some terminals.
Install:
On Ubuntu/Debian:
bash
sudo apt install mdcat
On Arch:
bash
sudo pacman -S mdcat
Usage:
bash
mdcat README.md
3. bat
Description: A cat clone with syntax highlighting and Git integration. It highlights Markdown syntax but doesn’t render formatting (like bold/italic), just colors.
Install:
bash
sudo apt install bat
Usage:
bash
bat README.md
4. pandoc (for conversion)
Description: Converts Markdown to other formats (like HTML or plain text).
Install:
bash
sudo apt install pandoc
Usage:
bash
pandoc README.md -t plain | less
Or to HTML:
bash
pandoc README.md -t html | w3m -T text/html
5. less with syntax highlighting
Description: You can use less with syntax highlighting by installing source-highlight:
bash
sudo apt install source-highlight
Then:
bash
source-highlight -s markdown -f esc < README.md | less -R
Summary Table
Tool
Renders Markdown
Syntax Highlighting
Easy Install
Best For
glow
Yes
Yes
Yes
Most users
mdcat
Yes
Yes
Yes
Images support
bat
No (just colors)
Yes
Yes
Quick preview
pandoc
Converts
N/A
Yes
Conversion
less+source-highlight
No
Yes
Yes
Custom workflow
In summary:
For the best Markdown experience in the terminal, try glow or mdcat!
Let me know if you want installation instructions for a specific Linux distribution or more details about any of these tools.