Introduction

The first thing we are going to learn are the fundamentals of the command line. Specifically, we will cover the basics of the Unix command line, where Unix refers to the family of operating systems that includes Linux and Mac OS, but you’ll still be able to follow along if you use Windows.

To start, you don’t need any previous knowledge. I’ll assume that you don’t even know what the command line is or why do we use it. But if you already know the basics of the command line, that’s totally fine, just go to the quiz/exercises portion at the end of each page and solve it.

We’ll start with the What and the Why of the command line.

What is the command line?

The command line is a way of interacting with your computer. It’s a program into which you can type text commands to perform specific tasks. From the command line, you can navigate through your files and folders, just as you would with a file manager like Finder on Mac OS or Windows Explorer on Windows. The difference is that the command line is fully text-based.

The value of using the command line lies in its power. For many tasks, it’s more efficient and flexible than a graphical environment. You can write scripts to automate common actions, run programs, and even combine simple commands to handle difficult tasks.

When we speak of the command line, we are really referring to the shell. The shell acts as the user interface to access your operating system’s services. This is the actual program that actually processes keyboard commands, passes them to the operating system and returns output.

Because we typically are running a graphical user interface in our computers, we need another program called terminal, this terminal acts as an interface for us to interact with the shell (Yep, we need an interface (the terminal) to interact with another interface (the shell), confusing, right?). In the terminal is were we’ll actually type the commands that order the computer what to do.

Why do we have to use the command line?

The command line is one of the best tools at your disposal as a programmer. These days it has become a sort of Swiss Army knife with features locked behind simple commands.

At the terminal you can easily create files and folders, install new programs on your computer, use Git version control (which we will learn later), and most importantly, utilize it to run the software we are going to write. Having a basic understanding of how the command line works is crucial if you want to become a good software developer.