Read Me First: A Take Control Crash Course
by Tonya Engst

Price: Free!
Download Ebook


Find more Take Control books!

Table of Contents

Mac Command Line Basics

Time and time again, you run across cool instructions, maybe a little on the geeky side, telling you to “enter” something “on the command line.” That “something” is a Unix command that tells your Mac what to do directly with OS X’s Unix underpinnings instead of working in the Finder or another app. In fact, many Unix commands have no equivalent in the Mac’s graphical user interface!

You access the command line from the Terminal application, which OS X stores in the /Applications/Utilities folder (see Following a Mac Path) .

① 	A Terminal window (foreground) and a Finder window (background) showing the Terminal app in the Utilities folder.

① A Terminal window (foreground) and a Finder window (background) showing the Terminal app in the Utilities folder.

Entering a Command

  1. Launch Terminal.
  2. Type (or paste) the command (uptime, in this example).

    The text appears after the prompt but before the cursor .

    ② 	With Terminal launched, just start typing at the prompt (in this screenshot, the prompt is `Sophie:~hestia$`.)

    ② With Terminal launched, just start typing at the prompt (in this screenshot, the prompt is Sophie:~hestia$.)

  3. Press Return (or Enter).

You may see a result or response in the Terminal window. The prompt and cursor appear on a new line .

③ 	Once you’re typed a command and pressed Return, Terminal may respond in some way. It also puts the prompt and cursor on a new line.

③ Once you’re typed a command and pressed Return, Terminal may respond in some way. It also puts the prompt and cursor on a new line.

Tip: For a longer command, if you can, copy and paste it on the command line in Terminal. That way, you’ll work faster and avoid typos.

A lot of Mac command line tips involve the defaults command, such as this one that makes the translucent menu bar opaque :

④ 	With a translucent menu bar, a dark Desktop background can be distracting.

④ With a translucent menu bar, a dark Desktop background can be distracting.

defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false

Tip: With long commands that break across lines, make sure you enter them as one line in Terminal.

With commands like these, it’s a good idea to verify how to reverse them before you enter them, just in case you don’t like the result. In this case, changing false to true in the same defaults write command makes the menu bar translucent again:

defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool true

You won’t see a response in the Terminal window after issuing a defaults write command, but you should see a new line with the prompt and cursor.

Some defaults write commands reverse controversial interface changes that Apple has made to OS X. At times, Apple later reverts to the previously default behavior and adds a control to the graphical user interface .

⑤ 	As you can see in this screenshot cut-out, Apple added a checkbox for whether the menu bar is opaque or translucent (red oval).

⑤ As you can see in this screenshot cut-out, Apple added a checkbox for whether the menu bar is opaque or translucent (red oval).

Note: For a thorough and friendly discussion of running your Mac from the command line, read Joe Kissell’s Take Control of the Mac Command Line with Terminal.

A Few Simple Unix Commands

Share this tip and chapter on

“To open a Terminal window with colors that are easier on your eyes, choose a theme from Shell > New Window.”

Discuss “Mac Command Line Basics” via below
comments powered by Disqus