You can use arrow keys to move the cursor in macOS Terminal.
Left and right arrow will move left and right by character.
Option-left and right arrow will move by word.
ctrl-A moves to the beginning of the prompt and ctrl-E moves to the end. 1/20
#macOS #Terminal #protip
Left and right arrow will move left and right by character.
Option-left and right arrow will move by word.
ctrl-A moves to the beginning of the prompt and ctrl-E moves to the end. 1/20
#macOS #Terminal #protip
When you want more memorable Keystrokes you can create your own in the ‘Keyboard’ tab of the ‘Profiles’ area of Terminal Preferences. 2/20
#macOS #Terminal #protip
#macOS #Terminal #protip
You can also navigate the Terminal prompt with the mouse pointer: Option-click (⌥-click) in the prompt moves the cursor there. 3/20
#macOS #Terminal #protip
#macOS #Terminal #protip
When you hold the option key, the mouse pointer turns into a crosshair. With option-drag, you can do rectangular text selection in Terminal. This is especially useful for certain list outputs. 4/20
#macOS #Terminal #protip
#macOS #Terminal #protip
You can double-click text in Terminal to select words, and triple-click to select lines. However, since 'words' end at slashes and other punctuation, you cannot select paths this way.
shift-command double-click selects an entire path or URL.
5/20
#macOS #Terminal #protip
shift-command double-click selects an entire path or URL.
5/20
#macOS #Terminal #protip
After selecting a path or URL, use shift-command V to type the selection at the current prompt without having to copy it to the pasteboard first.
6/20
(There is a bug where the selection disappears when you start typing, but it still exists.)
#macOS #Terminal #protip
6/20
(There is a bug where the selection disappears when you start typing, but it still exists.)
#macOS #Terminal #protip
When you already have a path in the clipboard, but it contains spaces and other special characters, you can use ctrl-command V to paste and escape.
(combine this with the previous tip: shift-ctrl-command V pastes and escapes the selection)
7/20
#macOS #Terminal #protip
(combine this with the previous tip: shift-ctrl-command V pastes and escapes the selection)
7/20
#macOS #Terminal #protip
You can use command-up arrow to scroll to the previous command prompt. You can then use command-down arrow to jump back to the next command prompt.
If you have a Touch Bar Mac, you will see these strange arrow buttons, which do the same thing.
8/20
#macOS #Terminal #protip
If you have a Touch Bar Mac, you will see these strange arrow buttons, which do the same thing.
8/20
#macOS #Terminal #protip
You can use shift-command A to select the output of the previous command.
9/20
#macOS #Terminal #protip
9/20
#macOS #Terminal #protip
You can use command-L to clear the output of the previous command. (This will not remove the command from the shell history.)
10/20
#macOS #Terminal #protip
10/20
#macOS #Terminal #protip
You can open man pages from Terminals help menu, use shift-command-slash to open the menu and start typing the command in the help search field.
11/20
#macOS #Terminal #protip
11/20
#macOS #Terminal #protip
This yellow man page window is extra useful because it is easier to scroll and you can use command-F to search for text.
You can of course use command-F in all Terminal windows, but it is especially useful in man page windows.
12/20
#macOS #Terminal #protip
You can of course use command-F in all Terminal windows, but it is especially useful in man page windows.
12/20
#macOS #Terminal #protip
Bonus: if you don’t like the ‘yellow’ background or want a different or larger font, you can change the look and feel for the man page windows by editing the ‘Man Page’ profile in Terminal Preferences.
12.1/20
#macOS #Terminal #protip
12.1/20
#macOS #Terminal #protip
You can also open man pages from the Touch Bar, just start typing a a command in the prompt and select the man page in the Touch Bar.
13/20
#macOS #Terminal #protip
13/20
#macOS #Terminal #protip
While we are talking about the Touch Bar, there are some useful items for the Terminal Touch Bar that are not placed there by default, use 'Customize Touch Bar…' from the 'View' Menu to change this.
14/20
#macOS #Terminal #protip
14/20
#macOS #Terminal #protip
Bonus: remember that Sidecar can add a Touch Bar to a Mac that doesn’t have one, like an iMac or Mac Pro.
14.1/20
#macOS #Terminal #protip
14.1/20
#macOS #Terminal #protip
One button you can add to the TouchBar is ‘Background Color.’ This allows you to change the background color for a Terminal window or tab. This is useful to highlight a ‘special’ window. It even provides a bunch of different color pickers.
15/20
#macOS #Terminal #protip
15/20
#macOS #Terminal #protip
The Profiles tab in the Info window (command-I) allows you to change the look and feel of an existing Terminal window or tab.
17/20
#macOS #Terminal #protip
17/20
#macOS #Terminal #protip
The Info Window also gives me an overview of the processes running in the Terminal window.
You can use the gear menu to get some more information and you can send signals, such as QUIT or KILL to a process.
18/20
#macOS #Terminal #protip
You can use the gear menu to get some more information and you can send signals, such as QUIT or KILL to a process.
18/20
#macOS #Terminal #protip
When you have arranged your 'perfect' terminal workspace, with multiple windows in different locations, maybe even remote connections, you can save this as a "window group."
Check 'Restore all commands' to reconnect to remote servers.
19/20
#macOS #Terminal #protip
Check 'Restore all commands' to reconnect to remote servers.
19/20
#macOS #Terminal #protip
This is a guest post written by @mischavdbent who doesn’t (yet) have his own blog! https://twitter.com/scriptingosx/status/1267794398370299909