Using the Terminal Application in Mac OS X


Learn the basics of launching and running the Terminal application in Mac OS X in this short tutorial which will allow you to access the power of the UNIX command line.

Let's Begin:

While almost all of us spend most, if not all, of our time using the graphical user interface to Mac OS X, a traditional command line interpreter is still available.  At times it is a useful way to get certain types of tasks done so it’s a good idea to know how to use it.  The Terminal application presents you with a standard UNIX shell.  By default is uses “bash” which stands for “Bourne Again Shell”, an updated version of the original UNIX shell that was written by Stephen Bourne at AT&T Bell Labs.  Anyone who knows UNIX will of course feel right at home using the Terminal application.

There are several ways to launch the Terminal app. It resides inside the Utilities folder which is within the Applications folder. Therefore, one way to launch it is to navigate your way to the Utilities folder with the Finder and then double click the Terminal app icon to start it:

screenshot of Mac OS X Finder window showing the contents of the Utilities folder

Another way to get to this window a little quicker is to use the Finder keyboard shortcut of shift-cmd-u. You of course need to make sure that the Finder is the current application for this shortcut to work, but it saves having to navigate through the  folders. You can double-click the Terminal icon to start it, or use more Finder keyboard shortcuts. Once the Utilities folder is open on the screen as shown above, you can type the first few letters of a file name to have the Finder highlight it. Unless you’ve installed other software that begins with the letter “t”, typing just a “t” should be enough to have Finder highlight the Terminal app. To launch it via the keyboard, just type cmd-o, the shortcut to “open” a file. “Opening” an application file causes the Finder to launch it.

A third and perhaps quickest way to launch the Terminal application is to use Spotlight. Press cmd-space bar to bring up the Spotlight search field, then type the first few letters of the word “terminal”. The Terminal app should show up right away in the list of choices. Just select it with the mouse, or use the arrow keys on the keyboard to move up and down the list of search results and hit return to select the Terminal which will launch it.

Once launched, the Terminal app will show a window with a command line prompt showing that it is ready to go. By default, the prompt shows the name of the computer, the user name you’re logged in as, and a dollar sign (the traditional UNIX shell prompt character).

screenshot of basic Terminal app window showing the command line prompt

At this point, you can type UNIX commands and bash will execute them for you. Try typing “date” to print the day and time or “ls” to list the files in the current directory.

screenshot of Terminal application showing output of some basic UNIX commands

If you’re not familiar with UNIX commands, this is not a good place to randomly experiment since there are commands that can do a lot of damage to your file system and machine configuration if you’re not careful.  Generally you should stick to typing commands that you know.

When you’re done using the Terminal, you can quit out of it just like any other application on Mac OS X by selecting Quit from the application menu or by using the keyboard shortcut cmd-q.

Category: Apple Mac OS X