Skip to content

Linux & Bash

The command line interface (CLI) is an invaluable addition to any developer’s toolbox. They have a uniform interface, allowing for easy usage and creation, as well as an easy way to combine them, similar to how you combine functions to make a program.

Due to their low barrier for creation, there are magnitudes more CLIs than graphical user interfaces (GUIs) for anything you could imagine. Need to check the spelling on a document? Need to slice a video? Need to buy coffee? Those can all be done from the CLI.

But why would you use the CLI over a graphical application?

Let’s take git as an example. Why would anyone use the git CLI over Github Desktop?

  1. Github Desktop doesn’t expose every option in git to you, because there would be hundreds of buttons. In the CLI, they are all accessible, and even can autocomplete options.
  2. Using the git CLI is faster than opening the GUI and clicking around. To add your new changes to git, all you have to run is git add -p to review them interactively, and git commit -m "updated..." to commit them.
  3. Sometimes they are your only option. If you ssh into a computer (more on this later), you don’t have a screen to show GUI programs.

Luckily, there is a fun and interactive way to learn the most common CLI tools. Plus, once you learn a few, the rest are super easy to pick up.

Head over to https://overthewire.org/wargames/bandit/ and don’t come back until you’re done. If you get stuck, try one more out of the box idea, and then head to the hints page (TODO).

What is the command to list files in a directory?