ARTASCIIcreate with characters
Practical guide · reproducible examples

Display ASCII art in a Bash terminal

In Bash, a here-document with a quoted delimiter preserves a drawing without expanding dollar signs, backticks or backslashes. Use cat to display a TXT file and check the window width.

Example 1: display a cat without changing shell settings

cat <<'ASCII_ART'
 /\_/\
( o.o )
 > ^ <
ASCII_ART

Paste the complete block into Bash. ASCII_ART is the delimiter; the last line must contain only that word, with no spaces. Quoting it on the first line prevents expansion inside the content, as described in the Bash manual, Here Documents. This command displays the drawing without changing startup files.

Example 2: display special characters literally

printf '%s\n' 'Prix: $5 | motif: 100% | /\' 

The first argument is a fixed format, %s followed by \n. The second is the text to display, in single quotes. The dollar stays literal and the percentage is not treated as a format. The shell’s quoting rules explain why. If the drawing itself contains a single quote, prefer the here-document in the previous example.

Read a downloaded file

cat -- dessin.txt

Open the directory where you saved the TXT and replace dessin.txt with its name. The file contains text to display, not a program to run. With GNU tools, -- marks the end of options. Do not use source dessin.txt to view a picture: source would ask the shell to interpret its contents. Quote paths containing spaces.

If the drawing overflows

A 100-column drawing does not fit an 80-column window. Reduce its width in the generator, enlarge the window or choose a shorter design. Reducing the web preview’s font size does not reduce exported columns. For tabs and symbols, use the alignment diagnostic.

Scope: Bash, not every terminal

These examples target Bash in a Unix-like environment, including an appropriate Bash session on Windows. They are not PowerShell or cmd commands. The terminal displays text; the shell interprets commands: these are separate roles. The examples use no ANSI colours. Simple ASCII art needs no control sequence; add colour only when you understand the target terminal. To create a banner, use the FIGlet generator.

Explore further