Command line gaming, once a staple of early personal computing, may seem antiquated in today‘s age of cutting edge AAA video game titles. However, there remains a thriving world of fun, challenging, and often free games perfectly suited for the Linux terminal. As an experienced Linux command line aficionado, let me be your guide to this retro gaming realm.
Brief History of Linux Command Line Gaming
In the early days of Linux and Unix systems, fancy graphical games were still in their infancy. All the action took place right in the terminal you used for your daily work. Simple yet addictive games like NetHack, Rogue, and Empire burrowed their way into users‘ hearts. The virgin frontier of Linux gaming coincided with the rise of genres like roguelikes and interactive fiction that thrived without graphics.
While Steam and graphical games now rule the scene, the Linux terminal remains home base for many gamers. The old guard continues going strong alongside new upstarts in this text based arena. Thanks to open source, they are free for all. The timeless gameplay still brings joy and makes grinding through tasks more fun. Let‘s highlight some of the bests from various genres.
NetHack – Granddaddy of Roguelikes
No article on Linux command line games is complete without the venerable NetHack. This iconic roguelike from the 80s still receives regular updates and remains as addictive as ever. The premise is simple – delve downwards through a deep dungeon, collect items to aid your quest, fight monsters, and retrieve the mystical Amulet of Yendor to achieve victory.
Sounds basic except the procedurally generated dungeon and enormous variety of items/creatures ensure no two games play the same. Quirky depth abounds, like using a stethoscope to listen a monster‘s heartbeat!

Image – NetHack remains one of the most popular CLI roguelike games [Source: linuxlinks.com]
Install NetHack on any Linux distro via the default repositories. Enjoy coffee break adventures, just don‘t get too attached to your character!
$ sudo apt install nethack #debian/ubuntu
$ sudo dnf install nethack #fedora
$ nethack
Empire – The Classic Wargame
If you enjoy historical strategy titles, Empire delivers tense WW2 action in your terminal. This classic from the 70s pits Allies against Axis in the struggle for Europe. Manage production, land troops, direct battles with statistics, and try to overwhelm your opponent. Empire eschews fancy graphics for surprisingly deep 4X style gameplay.

Vintage Empire remains one of the best CLI war games combining strategy and statistics [Source: cyberlore.com]
Install and play this pioneering wargame on Linux through repositories:
$ sudo apt install empire
$ empire
Dwarf Fortress – World Building Powerhouse
The brilliance of Dwarf Fortress defies textbook explanations. In short, govern a tribe of dwarves establishing a new home. Direct mining, farming, production chains, defense from monsters and much more. Craft legendary artifacts, decorate bedroom furniture, even compose new music! An insane level of simulation generates epic emergent narratives filled with drama.

Dwarf Fortress allows you to construct elaborate bases with materials mined by your settlers [Source:bay12games.com]
APIC and TwbT display fortresses in ASCII and are compatible with Linux. Get them from Bay12 site along with the game itself. Watch tutorials to grasp this unique gem:
$ ./df
$ ./apic
More Gaming Gems
Beyond these classics lie over a hundred more niche command line games for Linux worthy of attention across genres like:
Interactive Fiction
-
Anchorhead – Delve into this acclaimed horror title set in a mysterious mansion with creatures lurking inside. Type direction commands and puzzle solutions to proceed.
-
Lost Pig – Amusing comedy game where you must locate a missing pig by chatting with eccentric locals. Converse using natural language.
Both these and more interactive fiction titles are playable online or offline through command line interpreters like Gargoyle.
Puzzle
- Icy Tower – Jump ever higher up a tower teeming with obstacles and enemies trying to stop your ascent. Access this slick ncurses platformer via:
$ sudo apt install icytower
$ icytower
- 2048 – Recreate the viral puzzle game with numbers sliding on a grid. Use arrow keys to move tiles and combine into 2048! Install the CLI clone called "2048 game":
$ sudo apt install bsdgames
$ 2048
Retro/Arcade
- UFO2000 – Defend Earth from invading aliens in this open source X-COM style strategy game. Battle turn by turn on procedurally generated planets:
$ sudo apt install ufo2000
$ ufo2000
- Privateer Gemini Gold – Fly through space trading goods, fighting pirates, and taking missions as a mercenary pilot in this port of the classic DOS game.
$ sudo apt install privateer
$ gemini
Card Games
-
PokerTH – Bluff and bet against AI opponents in this online poker game sporting different styles, game modes and customizable tables.
-
Free Cell Solitaire – Relax with this classic single player card game. Stack cards properly based on suit to solve each deck.
Find these and more card games in apt repositories or alternatives like Homebrew.
For dozens more CLI titles spanning action, sports, board games and more, check out packages like:
BSD Games Collection – bsdgames meta package for Ubuntu/Debian featuring empire, pacman, tetris, adventure and more classic hits.
GAG (Gnu‘s Not Unix Games) – Fun pack with 100+ games like sudoku, minesweeper, connect 4.
Simply install via package manager and launch different games from the terminal.
Optimizing Terminal Emulators for Gaming
While most CLI games run fine in default terminal apps like GNOME, consider more gaming focused alternatives for best experience:
Cool Retro Term – Mimics old school CRT screens along with phosphor glow effects. Extensive customization from scanlines to curvature.
Hyper – Modern terminal loaded with features from global keyboard shortcuts to clipboard access between instances.
Tilix – Advanced tiling terminal supporting themes, quake mode, notifications and HTML-based customization.
Enable necessary features in your chosen terminal app:
Color Support – Vibrant and extensive color palettes bring games to life. 16 color mode works for many games while true color offers more depth.
Unicode Support – Essential for proper glyph rendering for games relying on special characters or internationalization.
Font Selection – Monospaced fonts like DejaVu Sans Mono are most compatible. Tweak size/weight for readability.
Keyboard Mappings – Map keys appropriately including modifiers or special inputs like arrow keys.
These terminal optimizations help CLI games reach their full aesthetic and functional potential. If graphics driver permits, also try blowing up font sizes for a retro pixel charm!
Engines and Languages Empowering CLI GameDevs
Thanks to abundant tools, developers continue pumping out traditional and new CLI games for Linux and beyond:
Game Engines
-
Crow Console Adventure Game Engine – Powering text adventure titles with Lua code for logic plus custom syntax for narrative scripting.
-
Lanarts ASCII Game Engine – Robust engine using Python, ncurses and pygame to craft 2D ascii games with graphics, effects and sounds.
-
librogue C Roguelike Game Library – Streamlined C framework for building your own roguelikes using provided pathfinding, FOV, rendering functions.
Programming Languages
-
Lua – Widely used for scripting CLI games thanks to easy to learn syntax, embeddable nature and quick execution. Powers CLIs for Roblox, Angband and more.
-
C++ – Provides performance benefits for computationally complex games like Dwarf Fortress. STL, smart pointers and namespaces aid development.
-
Python – Rapid CLI game prototyping with the rich PyGame library. List comprehensions and exception handling offer coding ease.
Here is a basic game loop example in Python showing input handling, screen clearing, render loop and random number generation:
import system, random
while True:
# get user input
direction = input("Which way?")
# game logic
if random.randint(0,10) > 5:
print("You encountered a monster!")
# clear screen
system(‘clear‘)
# render text
print("You head %s" % direction)
Languages like Lua and toolkits like ncurses provide similar capabilities as building blocks for your own CLI game imagination!
The Thriving CLI Gaming Scene
For a seemingly outdated game medium, command line titles continue enjoying surprising vitality in the modern era. Some numbers behind the still thriving scene:
- 620+ CLI games hosted on Debian/Ubuntu apt repositories alone spanning genres, 400 added in past 5 years
- Top roguelikes like Caves of Qud, Cataclysm DDA, Dungeon Crawl Stone Soup boast ~90,000 players and 10+ year active development
- NetHack maintains 6 different public game servers totaling ~1000 daily online players with peaks above 100k downloads
Much life springs from developer game jams aimed at innovating new CLI experiences like @ascii_jam and @RediscoverCLIGames on Twitter. Linux magazines spotlight the best genre releases yearly while enthusiasts curate massive lists like the 400+ Linux command line games spreadsheet.
Dedicated communities keep classics alive both on terminal and ported to Android, Nintendo Switch consoles. While the heyday ended decades ago, creativity continues with transpiling languages like TypeScript bringing next gen tooling. Everything old is new again with command line games thriving thanks to an active grassroots movement aligned with Linux/FOSS philosophy!
Keeping the Retro Flame Alive
Like vinyl records, command line games retain a special something lost in today‘s flashy HD titles. The primitive graphics and mechanics tap into our imagination rather than doing everything for you. Active development communities keep these open source treasures updated on modern Linux distributions for free. If you pine for the early days of PC gaming, give some of these classics and hidden gems across genres a try during coffee breaks or sporadic downtime. I think you‘ll be pleasantly surprised how a text based gaming experience makes the hours vanish!
Let me know your own favorite terminal game finds worth checking out!


