Computer hardware
Computer Software
Operating systems
Files, Folders, And the Command Line
What's next?

What is the Command Line?

Command Prompt using PIP

We’ve arrived at the most important topic of this course, a powerful aspect of computing that often goes unnoticed by many users: the command line! You’ve probably seen it in movies – a hacker rapidly typing into a black box full of green text – and thought it was just the stuff of fiction. In reality, it’s an incredibly practical tool that we can all use.

As an instructor, I get a lot of questions that come down to properly understanding the command line. It’s a common stumbling block for my students, and it’s the reason I created this specific course.

What it is

So, what is the command line? Also known as the terminal or console, the command line is a text-based interface where you can interact with your computer. Unlike the graphical user interface (GUI) you’re probably used to, where you interact with windows, icons, and buttons, the command line interface (CLI) allows you to execute commands directly by typing them in.

But why would you want to use the command line when you have a perfectly fine GUI? Well, for several reasons:

  1. Tasks taking multiple mouse clicks in a GUI can often be accomplished faster with a single command.
  2. The command line gives you access to more advanced system commands and tools unavailable in a GUI.
  3. Repetitive tasks can be automated by writing command-line scripts (in any language, including Python!)
  4. If you’re working on a remote server, perhaps in a cloud computing environment, the command line may be your only method of interacting with that machine
  5. Many small tools can be combined and chained to do complex things on the command line.

The command line is an indispensable tool for programmers. Many programming tools are command-line based, and understanding the command line can significantly enhance your ability to work with these tools. A solid understanding of the command line can help you troubleshoot problems, manage your files and directories more effectively, and get more out of your computer overall. It will give you a big edge over those that never bothered to learn about it.

Throughout the following lessons, we will delve deeper into the specifics of the command line in different operating systems like Windows, MacOS, and Linux. While they may look and feel slightly different, they all share the same principles.

Skip what you don’t need

I recommend you at least learn about the command line for your specific OS. E.g., if you use Windows, you could skip the sections about the Unix command line. The quizzes about the command line will be generic, meaning they apply to all OSes.

If you don’t skip lessons, that will be even better. It doesn’t hurt to read all the material, and even under Windows, it can be beneficial to know about the Unix commands and vice versa.