Apple

Mac Terminal basics: Unlock the power of the command line

Erik Eckel introduces Mac Terminal and defines some basic functionality that will help users learn to take advantage of its efficiency.

Workers are busier than ever. That's no secret. As a technology professional, regularly observing that Mac administrators, business owners, and users consistently miss opportunities to become more efficient and productive proves frustrating. But that's just what occurs when Mac administrators and end users overlook the Mac Terminal's capabilities.

Intimidating command line

It's fair to say most computer users are intimidated by the command line, or the interface by which text-based commands are entered to administer, manage and configure Macs. However, with minimal training administrators and end users alike can seize new power, and better understand their Mac's operation, by learning the basics of the Terminal's use.

Fear not

Fear's a powerful motivator. It's one of the reasons administrators and users waste precious time and energy attempting to diagnose computer problems and perform myriad actions that can often be more simply and efficiently undertaken leveraging a few basic commands. Using the Mac Terminal-which Apple describes as enabling "access [to] the complete UNIX environment using standard commands, tools, and scripting languages"-Mac operators can monitor processes, change permissions, create and delete files and much more.

Shell versus Terminal

The Mac Terminal, accessed from within the Application folder's Utilities subfolder, provides access to the Mac shell. The shell is actually the program that executes commands. The Terminal merely provides a customizable view in which users can change fonts and colors and open multiple tabbed shell windows.

How the shell works

When a user opens the Mac Terminal, a simple text-based window appears. Users can enter text, or commands, at the shell's prompt, which by default typically consists of the computer name and logged in user. For example, on my MacBook Pro, my default Terminal shell prompt appears as MacBook-Pro:~Erik$.

The Terminal itself does not run commands. Instead, the Terminal enables access to the Mac OS X shell, which reads the commands a user enters. When the user presses the Enter key, the shell runs the supplied command, performing any needed interpretations for additional options and information supplied by the user as part of the command. Finally, the shell also displays the processed command's result, which is referred to as output.

Configuring Terminal

Users can open new Terminal windows by pressing the Command and N keys. Alternatively, pressing the Command and T keys opens new tabbed Terminal windows. With Terminal open, clicking Terminal and selecting Preferences provides access to the Settings Preferences tab, from which color formats, fonts, window effects and numerous other customized options can be set.

More to come

In upcoming installments I will review how to better understand the Mac's directory structure. I'll also cover navigating the Mac shell, as well putting the Terminal to use troubleshooting common Mac network problems.

About

Erik Eckel owns and operates two technology companies. As a managing partner with Louisville Geek, he works daily as an IT consultant to assist small businesses in overcoming technology challenges and maximizing IT investments. He is also president o...

Editor's Picks