Conquer the command line: The Raspberry Pi terminal guide
5/5
()
About this ebook
Sometimes only words will do. Graphical user interfaces (GUIs) were a great advance, creating an easy route into computers for non-technical users. But for complex tasks, GUIs can block off choices and require a circuitous route even for simple tasks.
Enter the command line: the blinking cursor many thought had faded away in the 1990s. For getting instructions from user to computer — in a clear, quick, and unambiguous form — nothing beats the command line. It never disappeared on UNIX and Linux systems, and thanks to Raspberry Pi OS, a new generation is discovering how it simplifies complex tasks and lets you carry out simple ones instantly.
Build essential skills, including:
- Read and write text files
- Find and install software
- Manage removable storage
- Use Secure Shell (SSH) for remote access
- Write disk images to SD cards
- Browse the web from the command line
If you're not comfortable when faced with the $ prompt, don't panic! In this fully updated book, we'll quickly make you feel at home and get you familiar with the terminal on Raspberry Pi (or any Mac and Linux computer). Updated for the latest Raspberry Pi software, this book has everything you need to get started.
Richard Smedley
Since soldering together his first computer – a ZX81 kit – and gaining an amateur radio licence as GW6PCB, Richard has fallen in and out of love with technology. Swapping the ZX81 for a guitar, and dropping ham radio for organic horticulture, he eventually returned to the command line, beginning with a computer to run his own business, and progressing to running all the computers of an international sustainability institution. Now he writes about Free Software and teaches edible landscaping.
Related to Conquer the command line
Related ebooks
Raspberry Pi: The Ultimate Start Guide to Raspberry Pi Rating: 0 out of 5 stars0 ratingsLearning Raspbian Rating: 5 out of 5 stars5/5Raspberry Pi: Beginner's Guide - Learn Raspberry Pi in Easy Steps Rating: 2 out of 5 stars2/5Raspberry Pi :The Ultimate Step by Step Raspberry Pi User Guide (The Updated Version ) Rating: 4 out of 5 stars4/5Raspberry Pi: A Beginner's Guide to Raspberry Pi Programming Rating: 0 out of 5 stars0 ratingsRaspberry Pi User Guide Rating: 4 out of 5 stars4/5Raspberry Pi: The complete guide to Raspberry Pi for beginners, including projects, tips, tricks, and programming Rating: 0 out of 5 stars0 ratings50 Interesting Raspberry Pi Project Rating: 0 out of 5 stars0 ratingsRaspberry Pi 2: Beginners Step by Step User Guide offering 6 Ultimate Raspberry Pi Projects Rating: 0 out of 5 stars0 ratingsUnderstanding the Basics of Raspberry Pi: A User Guide to Using Raspberry Pi Rating: 2 out of 5 stars2/5Raspberry Pi: 40 Outstanding Raspberry Pi Tips and Tricks for Absolute Beginners Rating: 0 out of 5 stars0 ratingsRaspberry Pi Mechatronics Projects HOTSHOT Rating: 5 out of 5 stars5/5Raspberry Pi For Kids For Dummies Rating: 4 out of 5 stars4/5Raspberry Pi: Raspberry Pi programming for beginners, including Raspberry Pi projects, tips, tricks, and more! Rating: 0 out of 5 stars0 ratingsRaspberry Pi Server Essentials Rating: 0 out of 5 stars0 ratingsRaspberry PI: The Comprehensive Guide to Self-Taught Computer Technology Learning, Simple Setup, and Project Mastery Rating: 0 out of 5 stars0 ratingsRaspberry Pi 3 Rating: 0 out of 5 stars0 ratingsBuilding a Plex Server with Raspberry Pi Rating: 0 out of 5 stars0 ratingsPython Programming with Raspberry Pi Rating: 0 out of 5 stars0 ratingsRaspberry Pi for Secret Agents - Third Edition Rating: 0 out of 5 stars0 ratingsEasy Linux For Beginners Rating: 2 out of 5 stars2/5Raspberry Pi Zero Cookbook Rating: 0 out of 5 stars0 ratingsMake games with Python: Create your own entertainment with Raspberry Pi Rating: 0 out of 5 stars0 ratingsRaspberry Pi Hardware Projects 1 Rating: 0 out of 5 stars0 ratingsRaspberry Pi for Python Programmers Cookbook - Second Edition Rating: 0 out of 5 stars0 ratingsRaspberry Pi For Dummies Rating: 0 out of 5 stars0 ratingsSimple electronics with GPIO Zero: Take control of the real world with your Raspberry Pi Rating: 5 out of 5 stars5/5Raspberry Pi Super Cluster Rating: 0 out of 5 stars0 ratings
Operating Systems For You
Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5The Official Raspberry Pi Beginner's Guide: How to use your new computer Rating: 4 out of 5 stars4/5Bash Command Line Pro Tips Rating: 5 out of 5 stars5/5The Linux Command Line Beginner's Guide Rating: 4 out of 5 stars4/5Linux Bible Rating: 0 out of 5 stars0 ratingsmacOS Sonoma For Dummies Rating: 0 out of 5 stars0 ratingsPowerShell: A Beginner's Guide to Windows PowerShell Rating: 4 out of 5 stars4/5Linux for Beginners: Linux Command Line, Linux Programming and Linux Operating System Rating: 4 out of 5 stars4/5Linux All-in-One For Dummies Rating: 3 out of 5 stars3/5CompTIA A+ Complete Study Guide: Core 1 Exam 220-1101 and Core 2 Exam 220-1102 Rating: 0 out of 5 stars0 ratingsXDA Developers' Android Hacker's Toolkit: The Complete Guide to Rooting, ROMs and Theming Rating: 2 out of 5 stars2/5OneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5Windows 11 All-in-One For Dummies Rating: 5 out of 5 stars5/5MacBook Pro User Manual: 2022 MacBook Pro User Guide for beginners and seniors to Master Macbook Pro like a Pro Rating: 0 out of 5 stars0 ratingsHow to Build a Computer: The Best Beginner's Guide to Building Your Own PC from Scratch! Rating: 0 out of 5 stars0 ratingsDecode the iPhone 16 and iPhone 16 Pro: A Simple Guide to the 2024 iPhone and iOS 18 Rating: 0 out of 5 stars0 ratingsLearning Go Programming Rating: 5 out of 5 stars5/5Android: What It Is and How to Use It Rating: 4 out of 5 stars4/5iPhone For Dummies Rating: 0 out of 5 stars0 ratingsWindows 11 Manual For Seniors: A Beginners Guide to Navigate Your Computer with Step-by-Step Instructions Rating: 3 out of 5 stars3/5The Kubernetes Book 2025 Edition Rating: 0 out of 5 stars0 ratingsUnderstanding Apple Intelligence Rating: 0 out of 5 stars0 ratings
Reviews for Conquer the command line
1 rating0 reviews
Book preview
Conquer the command line - Richard Smedley
Conquer the command line,
3rd Edition
Raspberry Pi Essentials: Conquer the command line, 3rd Edition
by Richard Smedley
ISBN: 978-1-916868-38-0
Copyright © 2025 Richard Smedley
Printed in the United Kingdom
Published by Raspberry Pi Ltd, 194 Science Park, Cambridge, CB4 0AB
Raspberry Pi Ireland Ltd, 3 Dublin Landings, D01 C4E0, [email protected]
Editor: Rob Zwetsloot
Copy Editor: Nicola King
Interior Designer: Sara Parodi
Production: Brian Jepson
Photographer: Brian O’Halloran
Illustrator: Sam Alder
Graphics Editor: Natalie Turner
Publishing Director: Brian Jepson
Head of Design: Jack Willis
CEO: Eben Upton
May 2025: Third Edition
February 2019: Second Edition
January 2016: First Edition
The publisher, and contributors accept no responsibility in respect of any omissions or errors relating to goods, products or services referred to or advertised in this book. Except where otherwise noted, the content of this book is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0).
Welcome
Sometimes only words will do. Graphical user interfaces (GUIs) were a great advance, creating an easy route into computers for non-technical users. But for complex tasks, GUIs can block off choices and require a circuitous route even for simple tasks.
Enter the command line: the blinking cursor many thought had faded away in the 1990s. For getting instructions from user to computer — in a clear, quick, and unambiguous form — nothing beats the command line. It never disappeared on UNIX and Linux systems, and thanks to Raspberry Pi OS, a new generation is discovering how it simplifies complex tasks and lets you carry out simple ones instantly.
If you're not comfortable when faced with the $ prompt, don't panic! In this fully updated book, we'll quickly make you feel at home and get you familiar with the terminal on Raspberry Pi (or any Mac and Linux computer). Updated for the latest Raspberry Pi software, this book has everything you need to get started.
You can find information about this book, including errata, in its GitHub repository at rpimag.co/commandlinegit. If you’ve found what you believe is a mistake or error in the book, please let us know by using our errata submission form at rpimag.co/cmdlinefeedback.
About the author
Since soldering together his first computer — a ZX81 kit — and gaining an amateur radio licence as GW6PCB, Richard has fallen in and out of love with technology. Swapping the ZX81 for a guitar, and dropping ham radio for organic horticulture, he eventually returned to the command line, beginning with a computer to run his own business, and progressing to running all the computers of an international sustainability institution. Now he writes about Free Software and teaches edible landscaping.
Colophon
Raspberry Pi is an affordable way to do something useful, or to do something fun.
Democratising technology — providing access to tools — has been our motivation since the Raspberry Pi project began. By driving down the cost of general-purpose computing to below $5, we’ve opened up the ability for anybody to use computers in projects that used to require prohibitive amounts of capital. Today, with barriers to entry being removed, we see Raspberry Pi computers being used everywhere, from interactive museum exhibits and schools to national postal sorting offices and government call centres. Kitchen table businesses all over the world have been able to scale and find success in a way that just wasn’t possible in a world where integrating technology meant spending large sums on laptops and PCs.
Raspberry Pi removes the high entry cost to computing for people across all demographics: while children can benefit from a computing education that previously wasn’t open to them, so too can the many adults who have historically been priced out of using computers for enterprise, entertainment, and creativity. Raspberry Pi eliminates those barriers.
Raspberry Pi Press
store.rpipress.cc
Raspberry Pi Press is your essential bookshelf for all things computing, gaming, and hands-on making. As the official publishing imprint of Raspberry Pi Ltd, we publish a range of titles to help you make the most of your Raspberry Pi hardware. Whether you’re building a PC or building a cabinet, you can discover your passion, learn new skills, and make awesome stuff with our extensive collection of books and magazines.
Raspberry Pi Official Magazine
magazine.raspberrypi.com
Raspberry Pi Official Magazine is a monthly publication for makers, engineers, and enthusiasts who love to create with electronics and computer technology. Each issue is packed with Raspberry Pi–themed projects, tutorials, how-to guides, and the latest community news and events.
Chapter 1
Don’t Panic
We take a look around and discover that things aren’t as strange as they might appear…
It’s not a throwback to the past, but a quick and powerful way of getting your Raspberry Pi to do what you want, without all that repetitive strain injury-inducing menu chasing and icon clicking. The command-line interface was a great step up from manually toggling in your instructions in octal (base-8), using switches on the front of the machine! Graphical user interfaces (GUIs) brought friendly visual metaphor to the computer, losing some power and expressiveness. With Raspberry Pi, you can get the best of both worlds by knowing both: after reading through this guide, you’ll soon be as comfortable at the command prompt as you are at your desktop.
By default, Raspberry Pi OS boots you straight to a GUI, although you can change this behaviour in the settings. The command-line environment is still there: hold down the CTRL+ALT keys and press F1 (the first function key on the keyboard), and you’ll arrive at a virtual console. Press CTRL+ALT+F2 through to F6 and you’ll find five further consoles waiting for you to log in.
Figure 1-1: Anatomy of your command line
You can drop into these any time you like, but for now press CTRL+ALT+F7 and you’ll be back in mouse and menu land. The command line is also available through a program called a terminal emulator (sometimes referred to as a term). You’ll also find people referring to the shell, which is the program that runs in the terminal and interprets your commands. On Raspberry Pi and most GNU/Linux systems, the shell is a program named Bash (the Bourne Again SHell). Don’t worry about the distinction between the terminal and shell for now; just click on the icon at the top of the screen that looks like a black television screen, or go to Accessories > Terminal in the Raspberry Pi menu: the Terminal now awaits your commands.
Look around
If you’re used to looking at files and folders in a file manager,