Mac OS X Bag of Tips

Every day, I spend most of my work hours at the OS X terminal. Consequently, I accumulated a few tips and tricks I would like to share with the readers.

Selecting Text

  • To select a word, double click on that word. The terminal is smart enough to discern when the period acts as a sentence terminator and when it is part of a file name. In the later case, the whole file name is selected. After double clicking and before releasing the mouse button, the user can drag the mouse to select additional words
  • To select a line, triple click on that line and drag the mouse up or down to select additional lines
  • To select space-delimited text, hold down Command and Shift and double click on the text. This action is useful for select path names. If the path name contains one or more spaces, drag the mouse to select the rest
  • If the user holds down the Command and Shift keys and double click a URL, OS X will open that URL in the default browser
  • If the user holds down the Option key, the mouse pointer will change to a cross hair for selecting column of text. An example of this application is for selecting the output of the ls command

Windows Management

  • The Command+1 combination will bring the focus to the first window, Command+2 to the the second and so on.
  • The Command + left/right arrows switch between terminal windows
  • Like other OS X applications, the Command + ` also switches between windows
  • The Shift + Command + [ or ] combo switch between different tabs
  • The Command + up/down arrows scroll through the window’s buffer, one line a time; the page up/down keys scroll one screen.
  • The Window > Split Pane menu or Command + D will split the window into two panes–useful for scrolling back to review previous text and/or select them

Saving a Transcript

  • To save the plain text transcript of all interactions since the window opened, click on the Shell > Export Text As… menu
  • To save the PDF transcript, click on the Shell > Print…, click the PDF button and select the appropriate choice

Window Group

I usually open two windows and arrange them side by side. Window group is a nice feature which helps me defining a group of windows for later use. To define a window group, first open as many windows as you would like and arrange/resize them. Next click the Window > Save Windows As Group… menu and give it a name. The “Use window group when Terminal starts” check box is self-explanatory.

Conclusion

These are just a handful of tricks that I can remember. I am sure the Terminal has more up its sleeve, waiting for us to discover. If you know a trick, please feel free to comment.

2 thoughts on “Mac OS X Bag of Tips

  1. Eric Christopherson

    Nice tips! One correction: “To select space-delimited text, hold down Command and Shift and double click on the text” should say “slash-delimited” instead of “space-delimited”.

  2. Milan Andric

    The space delimited select works fine for me. I’m on snow leopard.

    But one side effect of this key/mouse combo is it also open applications. This is a bummer since I just want to select text. So if you cmd+shift click a link it opens in a browser and with an email address it will open your mail client. Too bad there’s isn’t a way to do the space delimited select without the app launch.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s