
How to Play Classic Games in Linux Terminal: A Beginner’s Guide
Unlike most Mac and PC users, Linux users spend quite a bit of time working with the terminal. That doesn’t usually involve gaming, but the bar is definitely lower for Linux gamers to try out a few command line games.
If this is up your alley, terminal games on Linux can offer hours of fun with their lightweight gameplay. Classic games like Ninvaders (a command-line interface version of Space Invaders) and Bastet (the Tetris of Linux) bring back nostalgia without fancy graphics.
Let’s have a closer look at how to enjoy games on your Linux terminal.
How to Launch Games in the Linux Terminal
You don’t have to be a coder or Linux terminal expert to give gaming a try. On the whole, it’s definitely easier than getting emulators to run and you can be assured that you don’t need to worry about overclocking. Terminal games need a few simple commands to launch.
Understanding executable files
Linux handles executable files differently from Windows. File extensions don’t determine if a program can run – permission settings make that decision. Terminal games are programs that need execution permissions enabled. This allows the system to run them as applications instead of treating them as text or data files. Always be careful when running executables and make sure you trust the source (official repositories preferred).
Using chmod to make files executable
Games need execution permissions before you can play them. The chmod
command (change mode) helps modify these file permissions:
chmod +x game-name
This command lets everyone execute the file. You can also set more specific controls:
chmod u+x game-name
– Only you (the owner) can execute itchmod 755 game-name
– Owner can read/write/execute; others can read/execute
Running games with ./game-name
Executable games can run directly from the terminal. From the game’s directory, type:
./game-name
Linux looks for the executable in the current directory when you use the ./
prefix. Without it, the system searches only predefined paths. Games installed in system directories often run by just typing their name without ./
.
Directing through folders with cd command
Finding your games requires moving through the file system. The cd
(change directory) command helps you do this effectively. These simple navigation commands make locating games easier:
cd /path/to/games
– Direct to a specific foldercd ..
– Move up one directory levelcd ~
or justcd
– Return to your home directorypwd
– See your current location (print working directory)
The ls
command shows available games after you reach the right folder.
Geting Started: 8 Games You Can Play in the Terminal
The Linux terminal has some amazing classic games that blend nostalgia with pure computing fun. Here are some entertaining options you can try right now.
1. Ninvaders – Space Invaders clone
Your terminal transforms into an arcade with Ninvaders, a Space Invaders clone. You’ll control a cannon using arrow keys and blast aliens with the spacebar. You can install it with sudo apt install ninvaders
or sudo dnf install ninvaders
based on your distribution. Just type ninvaders
to start playing.
2. nSnake – The classic snake game
Image source: It’s FOSS
Miss the addictive Nokia snake game? nSnake brings back those memories right in your terminal. Getting started is easy – use sudo apt-get install nsnake
for Ubuntu/Mint or sudo dnf install nsnake
for Fedora. Launch with nsnake
, use arrow keys to move, P pauses the game, and Q lets you quit. You can tweak the game speed and border settings from the start screen.
3. Tint or Bastet – Terminal Tetris
Tetris lovers have two great choices. Tint (Tint Is Not Tetris) comes with 9 difficulty levels and vi-style controls. Bastet (“bastard Tetris”) takes a different approach – its algorithm gives you the worst possible brick to make the game extra challenging. Both games are available through your package manager.
4. Pacman4Console – Retro arcade fun
This ASCII-based Pacman puts you in control of ‘C’ as you zip through mazes eating dots while dodging ghosts. Get it with sudo apt install pacman4console
and start with the pacman4console
command.
5. Moon Buggy – Jump and shoot
Moon Buggy puts you behind the wheel of a lunar vehicle jumping over craters. The spacebar makes you jump while ‘a’ or ‘l’ fires weapons. Type sudo apt install moon-buggy
to install and moon-buggy
to play.
6. Greed – Number-based puzzle
This clever puzzle surrounds you (marked as ‘@’) with numbers. Each move eats up squares based on the number you land on. The challenge lies in consuming as many numbers as possible before getting stuck.
7. 2048 – Addictive number game
This popular sliding puzzle challenges you to merge tiles until you hit 2048. Get it running with: wget https://raw.githubusercontent.com/mevdschee/2048.c/master/2048.c
and then gcc -o 2048 2048.c
8. Nudoku – Sudoku in the terminal
Nudoku is perfect for number puzzle fans. A quick sudo apt install nudoku
or sudo dnf install nudoku
gets you started. The game offers various difficulty levels and can even solve puzzles when you’re stuck.
Install and Explore BSD Games Collection
Linux users can enjoy the complete BSD Games collection – a package with dozens of classic text-based Unix games from decades past. These timeless games bring authentic retro gaming right to your terminal.
How to install bsdgames package
The installation process differs slightly based on your distribution:
# Ubuntu/Debian
sudo apt update
sudo apt install bsdgames
# Fedora
sudo dnf install bsd-games
# Arch/Manjaro
sudo pacman -S bsd-games
You can start any game by typing its name in the terminal after installation.
Popular games in the package (Hangman, Backgammon, Go Fish)
The package has many classics that might take you back to your childhood:
Hangman: A word guessing game that builds vocabulary. Start playing by typing hangman
.
Backgammon: This ancient board game dates back 5,000 years. Players can compete against the computer or challenge friends using the backgammon
command.
Go Fish: Your terminal brings this classic card game to life. Start playing with the go-fish
command
Text-based adventure games (Adventure, Wump, Battlestar)
Several engaging text adventures stand out in this collection:
Adventure: Players explore caves and collect treasures in this groundbreaking 1970s text adventure.
Wump: Players must hunt the Wumpus through dark underground caves without becoming its next meal.
Battlestar: This 1979 space adventure focuses more on exploration than puzzle-solving.
Tips for a Better Terminal Gaming Experience
Linux terminal-based games become more enjoyable with a few adjustments and tips that can substantially boost your gaming experience. These simple tweaks will help you get the most out of your command line games.
Resize terminal for better visuals
Most terminal games need adequate screen space to display properly at the time you first run them. The resize
command helps adjust your terminal window:
resize -s 50 50
This adjustment sets your terminal to 50 rows by 50 columns. You can make permanent changes by updating your terminal’s profile priorities. Many games mention that players need to re-size the window and keep it a bit big/wide to be able to launch the game.
Use arrow keys and spacebar effectively
Standard keyboard controls are common in terminal games that Linux provides. Players who become skilled at these controls can enjoy games of all types:
- Arrow keys: Control movement in most games (up/down/left/right)
- Spacebar: Usually for actions like firing, jumping, or rotating pieces
WASD keys serve as an alternative to arrow keys in some games. Each game displays its specific controls during launch.
Summing Up
Linux terminal gaming combines nostalgia and simplicity in a way that let’s you take a breather from graphics-heavy games (or from work). Remember that the best visual experience comes from a properly sized terminal window.
Sure, terminal games won’t replace modern AAA titles, but they offer a charming alternative that connects us to computing’s history!