If you are new to programming, you likely have very limited experience working within the context of a terminal window. You probably have written most of your code in Python or JavaScript through a website or application like repl.it or Visual Studio Code.
Such tools greatly simplify the interactions we have with our computer by providing convenient, point-and-click interfaces. It makes immediate, perfect sense that we ought to click the triangular ‘Play’ button in the top right corner to execute our program:
There’s nothing wrong with these tools! In fact, most of the time you spend developing will likely be in an environment like this, and becoming proficient with them is part of becoming an effective developer!
But it is important to understand that these environments are providing a simplified interface to help you along. You are making a trade, exchanging your direct authority over the program for an intuitive GUI.
An intuitive Graphical User Interface is a product of its own! You will find that for many tools you utilize as a developer, it doesn’t make sense for a GUI to be included. In cases like this, your best (and only) option will be to interact via a Command Line Interface (CLI) through your Terminal application.
Interacting through your terminal brings you one layer closer to the technologies you are leveraging. The variety of commands you can issue expands dramatically, and your ability to fine-tune the behavior of those commands likewise increases.
A terminal provides a Command Line Interface (CLI) to the console of your computer. When you provide commands via your terminal, your operating system interprets those commands through the shell, and executes your orders!
Any action performed by your computer can be executed as a command through the terminal. Navigating through your file structure, opening applications, executing that ‘hello world’ program you just finished, all this and more is available through the single interface of a terminal!
You may be accustomed to using clicks as the primary communicator with your computer…but put that mouse down! In a terminal environment, it’s crucial that you become very comfortable keeping your hands firmly on your keyboard.
There are various terminal applications available, on Windows 11 and MacOS these are simply called ‘Terminal’. You could also use a program like Git Bash or iTerm. The main concern you should have when picking a terminal app is what shell the terminal is communicating to.
The three most common shells are Bash, Zsh, and Powershell. Bash and Zsh share most common commands, while Windows Powershell is truly its own beast. I have only spent time learning commands that are valid in Bash and Zsh, and will not provide any Powershell examples.
Find your terminal! Perform a spotlight search on your device, searching for ‘terminal’ and you should find your terminal app.
<aside> ⚠️ If you are using Windows, search for Git Bash and install if necessary. This application will allow you to use Bash commands on your Windows device and follow along with the following examples.
</aside>
// pwd, cd, mkdir, touch, and python