Getting started with the Mac Terminal

The Mac operating system is a Unix-based on graphical user interface. You can therefore interact with your Mac computer using many (most) of the same commands used in Unix/Linux systems. Many of these commands achieve the same things that you can achieve using 'point and click' methods. For instance, if you wanted to create a new folder on your Mac desktop you could click on your desktop, select File > New Folder. But you can also create a new folder using Unix commands in Mac's Terminal.app (which can be found in Applications/Utilities/Terminal). This will open a “command line” interface (meaning that you interact with the computer by typing out commands rather than pointing and clicking with your mouse/trackpad). By typing the following commands (press enter/return after each line) you will change the directory of your command-line interface to your desktop and create a new folder entitled “mynewfolder”

cd ~/Desktop
mkdir mynewfolder

At this point you are undoubtedly thinking “It was way easier to just use the trackpad, so why would I ever want to use the command-line!?” However, the command-line gives you direct control over many aspects of your computer that would be hard (or impossible) to access via the graphical interface. More importantly for our purposes, we can write our commands into a text file and then tell the computer to read the commands from that file (this file is called a “bash script” because the particular Unix language that we'll be using is called “bash”.) This is great because it means that every time we do whatever task we've “scripted”, we can be certain that we're doing it exactly the same way we did it last time. Moreover, if we need to create 100 new folders we can just tell the computer to read the bash script 100 times. Imagine creating those same 100 new folders by pointing and clicking!

UNIX Introduction

UNIX Tutorial

UNIX Help

Linux.org tutorial

Linux tutorial - includes glossary and forums

Top 10 bash shell tips