Command Line 101: a Basic Guide to Using the Terminal

Get started using your terminal and get one step closer to being an experienced developer.

Armand Sauzay

--

Photo by Max Duzij from Unsplash

All of the code for this tutorial can be found here.

Developers use the command line to navigate through file and perform operations. Once you get used to it, it is definitely the most efficient way to access files and perform operations. Also, when you start virtual machines on the cloud, it becomes the only way of easily communicating with your instance. So, without further due, let’s learn about the terminal and basic commands to get started!

In this article, we’ll cover what is the command line, which commands we can use and we’ll go through a simple tutorial to put those commands in practice.

First, what is the command line?

It is a plain and simple text interface for your computer. It takes commands which are then passed to the OS to run.

And which commands can we use?

The usual commands are given in the table below.

Let’s now go through a small example on how to use those commands.

  1. Let’s see where our terminal currently is:
pwd

2. Navigate to the folder where you usually put your code (I usually have mine in a folder called `code` in your my folder)

cd path/to/your/folder/of/code`

- for me for instance, I have got a `code` folder under /Users/myusername so I can do the following

 cd
cd code

Explanation:

  • cd: brings me back to my root folder
  • cd code: changes my working directory to code

3. Go to /create a folder called command_line_tutorial


echo “Create a folder named command_line_tutorial and go to it”
if [[ -d…

--

--

Armand Sauzay

Applied Scientist at Turo - ex Airbnb - ex Amazon - UC Berkeley