Use a terminal to install homebrew – and a better terminal

We want to set you up for working with the command line. This is a reasonable early step towards learning how to code because you will immediately be using text based commands to make the computer do things – instead of just clicking and tapping, or swiping and talking for that matter :)

Open the terminal by pressing command+space, typing Terminal, and pressing enter.

You can press command++ to make the text bigger.

You can also use all sorts of programs on on the command line like cd for changing directories or ls for listing contents of directories. You can use open to open files too.

You can prefix any command with man to see the manual for it, e.g. man cd. Press q to close the manual.

You can use Tab to autocomplete file names. You can use the left and right arrow keys to move your cursor left and right. You can use the up and down arrows to navigate through your command history. And you can use ctrl+a to jump to the beginning of your line or ctrl+e to jump to the end of it.

Once you are done with that, we want to install Homebrew a package manager which we can use to install all sorts of things to your Mac – including a better terminal, a.k.a. command line interface. You will use this for lots of things.

Paste this command in and press enter:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Generally speaking you don't want to paste things into the terminal that you don't understand. That's because they could be destructive or malicious!

This one won't be bad – but let me explain what it does. It uses bash, a special type of program called a command program called a shell to execute a script called install.sh that it downloads from Github via the curl program. You can view the script here but it might be a little confusing for now.

So after that's run, let's use it to install a better looking and more functonal terminal, iterm2.

brew install iterm2

Use the same command+space approach to open iterm (it's still called iterm here even though it's iterm2 elsewhere).

You can read more about why iterm(2) is handy here.

That's enough for day one.