This book is for anyone who wants to learn Linux from scratch or deepen their understanding of the command line. No prior experience is required, but a willingness to experiment and learn is essential. If you’ve ever thought, “I should really learn Linux,” this is your sign to start.
The book is divided into four parts:
1. Learning the Shell: Master the basics of the command line.
2. Configuration and the Environment: Customize your shell and work efficiently. 3. Scripting: Automate tasks with shell scripts.
4. Advanced Topics: Dive into networking, text processing, and more.
Each chapter builds on the previous one, so take your time, practice the commands, and don’t hesitate to experiment. Remember, the only way to break Linux is to try really, really hard—so go ahead, break it! (Just kidding, but do experiment fearlessly.)
Linux is everywhere—from servers powering the internet to the Android phone in your pocket. It’s free, open-source, and incredibly powerful. Whether you’re a developer, sysadmin, or just a curious tech enthusiast, learning Linux is a skill that will pay dividends for years to come.
Debian is one of the most stable and widely-used Linux distributions. It’s the foundation for many other popular distros like Ubuntu. We’ll be using Debian 12 (Bookworm) as our base, but the concepts you learn here will apply to almost any Linux distribution.
The main purpose of this book is to familiarize you, the user, with the different linux command line tools and what they can achieve. We will use a mix of "Classic" or traditional and "Modren" or newer tools in this book.
When it comes to command-line tools in Unix and Linux, there’s an interesting split between classic tools and their modern alternatives. Classic tools like cat, grep, man, and ls have been around since the early days of Unix. They’re simple, reliable, and follow the Unix philosophy of doing one thing well. These tools are the foundation of countless scripts and workflows.
On the other hand, modern tools like bat, tldr, eza, and ripgrep bring new features to the table, such as syntax highlighting, better performance, and more user-friendly outputs. The choice between classic and modern tools often comes down to what you value more: the reliability and compatibility of the classics or the enhanced features of the newer tools.
While modern tools can make workflows smoother and easier to learn, classic tools are still widely used and trusted. In many cases, the best approach is to use a mix of both—classic tools for their universal availability and modern tools for their added convenience. It’s all about finding the right balance for your needs!
You might wonder why I’m mentioning the computer I used to test and run the commands in this book. After all, isn’t Linux supposed to run on anything from a Raspberry Pi to a supercomputer? While that’s true, knowing the specs of the machine used for testing can help you set realistic expectations and understand the context in which the commands and tools were tested.
For this book, I used a Lenovo ThinkCentre M900 Tiny with the following specifications:
- Processor: Intel i5-6500T (a quad-core CPU from 2015)
- RAM: 32 GB - Storage: 500 GB NVMe (primary disk) and 1 TB M.2 SATA (secondary)
- Operating System: Linux Mint Debian Edition (LMDE 6) with XFCE desktop
This machine, though nearly a decade old, has been upgraded with additional RAM and fast storage, making it perfectly capable of handling everything from basic commands to more complex tasks. It’s what I’d call a mid-to-lower range computer by today’s standards—ideal for learning Linux, running everyday applications, and even some light programming. However, it’s not suited for heavy workloads like gaming, video editing, or large-scale data processing.
You might ask, “Do computer specs really matter for a book about Linux commands?” The answer is both yes and no.
No, because the commands and concepts in this book are universal. Whether you’re running Linux on a high-end workstation or a Raspberry Pi, ls will list your files, and echo will print text to the screen. Linux is designed to be lightweight and efficient, so even older hardware can handle the basics with ease.
Yes, because the performance of certain tasks (like compiling software, running virtual machines, or processing large datasets) can vary significantly depending on your hardware. By sharing the specs of my machine, I hope to give you a benchmark for what’s possible on modest hardware. If your computer is similar to or better than mine, you can confidently follow along with all the examples in this book.
This book is written with the belief that Linux is for everyone. You don’t need the latest and greatest hardware to get started. In fact, one of Linux’s greatest strengths is its ability to breathe new life into older machines. My 10-year-old ThinkCentre is proof that you don’t need cutting-edge technology to learn and enjoy Linux.
So, whether you’re using a vintage laptop, a budget desktop, or a shiny new machine, this book is for you. Let’s embark on this journey together, and by the end, you’ll not only understand Linux but also appreciate its power, flexibility, and simplicity.
This book is published under Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).Read more about this license at the License page of this book.
Now that we’ve set the stage, let’s dive into the world of Linux. In the next section, we’ll start with the basics: understanding the shell and how to interact with it. Whether you’re a complete beginner or someone looking to refine your skills, this book will guide you step-by-step, with practical examples, a friendly tone, and a touch of humour.
Let’s get started!