1 Welcome to Command Line Tools

We use a variety of interfaces to control computers. The two most common software-based interfaces are:

  1. The Graphical User Interface, GUI, and
  2. The Command Line Interface, CLI

We all use GUIs all that time. Almost everything that contains windows, icons and things you can click on, are GUIs.1

The CLI is almost exclusively text-based2. The CLI is much older and today’s typical computer user is unlikely to even know it exists. In contrast, data scientists will inevitably use the CLI as part of their routine work.

To use the CLI, commands are typed at the command prompt, which is a symbol such as > or $ followed by a blinking3 cursor, |, common to all user interfaces expecting text input. This is the command line and these commands comprise a set of Command-Line Tools, CLT.

If your operating system, OS, is a GUI, you’ll need to open a terminal window to access the command prompt. Thus, you’ll also enter commands in the terminal.

One last note, to round out the discussion. An Integrated Development Environments, IDE, is a program to help you work with text. Later on we’ll use RStudio and VS Code for working with R and Python. They are not quite GUIs, but they do provide some graphical support.

1.1 Learning Objectives

Knowing how to use the CLI correctly and productively is a fundamental skill for data scientists. Aside from being necessary in some cases, their ability to automate and simplify tasks makes them invaluable. Nonetheless, it takes time to become a master. Our goals are more humble.

By the end of this module, you’ll know what the CLI is and what advantages it provides. You’ll be able to use the CLI to:

  • Navigate your computer’s file system.
  • Execute and combine useful & common commands.
  • Run shell scripts and define environment variables.