MacOS Keyboard Shortcuts for Terminal Users

Despite its reputation for flashy graphics, macOS has a number of nifty features and shortcuts for terminal users. Here are some of my favourite keyboard shortcuts within the Terminal application itself:

  • ⇧⌘a (“shift-cmd-a”) to copy the output of the last command.
  • ⇧⌘v (“shift-cmd-v”) to paste the currently selected text.
  • ⌃⌘v (“control-cmd-v”) to paste escaped text.

The following keyboard shortcuts work in other applications:

  • ⌥⌘c (“option-cmd-c”) in Finder will copy the path to the selected file(s) (via @scriptingosx).
  • ⇧⌘. (“shift-cmd-fullstop”) toggles show hidden files, even in file open/save dialogs (via @howardnoakley).
  • ⌃t (“control-t”) transposes the two characters to the left of the cursor (via @eWhizz).

While testing the copy & paste shortcuts in this post, I also discovered—after 15 years of being a Mac user—that Finder has the ability to show the current contents of the clipboard (Edit→Show Clipboard).