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.
- 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
- 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
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.
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.