Terminal

Supposedly...

The Mac Terminal is a command-line interface (CLI) for the macOS operating system (OS).
The Terminal is typically used by network administrators and advanced technical users who want to initiate an action that is not supported by the operating system's graphical user interface (GUI).

Dafuq does that mean

Back in the medieval times of gruel and mutton, computers did not quite work the way they do today.
This ain't a history lesson on computers, they've been around for a while.
Let's just say that even when computers started becoming available for home use, there weren't these beautiful graphical user interfaces you're familiar with today.


As you can see from the pictures above, there was no "start button" or "recycle bin".
There was no mouse pointer to drag around a desktop.
Heck, there wasn't even a desktop!
So then how did a user interface with a computer?
Meaning, how did someone sit in front of a computer and tell the computer what to do?

Command-Line Interface

A CLI processes a command, and a command is something like "open this folder", "run this program", "delete this file", etc.
If I wanted to open my "Joon" folder today, I'd simply grab my mouse, drag the cursor to that folder, and double-click it.
In the olden days, you had to type "open Desktop/Joon" (or something along those lines) into the CLI to do exactly that.

Why programmers use a CLI

Okay great, so cavemen used to type stuff into computers to execute commands. Big freakin' deal.
Why do you have to learn the Mac Terminal, MS DOS, etc. when you can set your desktop background to your next holiday destination and fondly gaze at it as you navigate your mouse and double-click to your heart's content?
There are many reasons why a CLI is used by every worthwhile programmer: speed, simplicity, automation, using less resources, etc.
However, the "why" is not that important at this point.
We do not yet need to understand the intracies of computer science nor are we reinventing the wheel.
What's important is that you learn to use a CLI (in this case, the Terminal).

Some Basic Terminal Commands

clear

clear the terminal screen

ls

display the names of files and subdirectories in current directory

cd

move to the home directory (the root folder)

cd <dir>

move to <dir> directory

cd ..

move up to the parent directory

cd -

move back to the previous directory

mkdir <dir>

create a new directory

touch <file>

create a new file

rmdir <dir>

delete an empty directory

rm -R <dir>

delete a directory and its contents

rm <file>

delete a file

mv <file> <newfilename>

move or rename a file

Open up the terminal and try out some of these commands!
Try not to delete any thing though.
Next, let's learn a little bit about Github.

Next: Intro to Github

Return to main page