For most people, the terminal is one of the most dreaded parts of learning to code. It’s unintuitive, not directly related to coding, and for many people, plain boring.
Why learn the terminal/Bash? Because for developers, especially back-end developers or systems engineers, it is a vital tool for setting up, running, and debugging code. In the future this may not be the case as more and more environments become graphical and user-friendly. But since we’re not there yet, here are three big reasons why every developer should know Bash commands.
1. Most runtime environments, frameworks and other technologies are run from the command line
Runtime environments and compilers such as Node, Bun, TSC, and GCC all must be run from a terminal.
Databases like MongoDB have specific commands used to start them up, stop them, check their status, and so on.
Even front-end frameworks like React have to be installed from the command line.
There is no way developers could operate without these kinds of technologies. And the truth is, almost all of them are console-based. As a developer you really don’t have a choice but to use the terminal on a daily basis, whether you love it or hate it.
(I personally love using the terminal — in fact, Ubuntu Linux is the only operating system I have used for months. But I’m aware that most people don’t share that sentiment.)
2. Using commands is often faster than the equivalent GUI method
It’s a fact that wrist action slows you down when using a computer. That’s why the first rule of VS Code productivity is, Drop the mouse, and use keyboard shortcuts.
When you perform all of your tasks using the keyboard, the time it takes to point and click with the mouse is eliminated and productivity is increased.
For example, below are the steps required to open a script,
script.js in the
Code folder, using the VS Code GUI:
- Find the VS Code icon on your screen and click or double-click it.
- Click on the File menu on the top.
- Find the “Open File” option and click it.
- In the new window, scan around for your
Codefolder and double-click it.
- Find the file,
script.js, and double-click it.
In contrast, here are the steps required for the same task using the terminal:
- Press Ctrl + Alt + T to open a terminal. (Or not, if you’re like me and always have it open.)
- Enter the command
$ code Code/script.jsusing the Tab key to autocomplete each part of the path and save even more time.
Of course, using the command line is not immediately faster than using a GUI. When you first start using the terminal, it will actually be slower as you try to remember the right commands and how to enter them. But with practice, the commands will become second nature. (And besides, they’ll make you look like a computer genius to Windows users.)
3. Using the terminal gives you unlimited control over your system
This is especially true in Linux environments, in which almost every aspect of your system can be altered with a few keystrokes.
Of course, you should keep in mind Uncle Ben’s timeless warning to Linux users: “With great power, comes great responsibility.” The unbounded control can get you into trouble fairly easily. Playing around with your operating system is the fastest way to shoot yourself in the foot. But if you know what you’re doing, the power of the command line is both useful and incredible.
Even developers using Windows or macOS have a little more control when they open a terminal, with reasonable limitations imposed by Microsoft and Apple.
With a combination of powerful command-line utilities, various flags added to commands, and technical savvy (a.k.a. Google searches), you can generally make your system do whatever you want it to do.