{ claus.conrad }

macOS

https://www.apple.com/macos/

Desktop [operating system](…/Operating systems/) for Apple hardware

Keyboard shortcuts

KeyFunctionNote
++Q / power buttonLock computerDefault
++QLog outDefault
++WClose windowSome apps
+SpaceSpotlightDefault
+SpaceRaycastCustomized (Raycast)
+ZUndoDefault
+TNew tabSome apps
+WClose tabSome apps
++SpaceRaycast emoji pickerCustomized (Raycast)
++Left ArrowMove window to left half of screenCustomized (Magnet)
++Right ArrowMove window to right half of screenCustomized (Magnet)
++Numpad1Move window to bottom-left quarter of screenCustomized (Magnet)
++Numpad3Move window to bottom-right quarter of screenCustomized (Magnet)
++Numpad7Move window to top-left quarter of screenCustomized (Magnet)
++Numpad9Move window to top-right quarter of screenCustomized (Magnet)
++Maximize windowCustomized (Magnet)
++Restore windowCustomized (Magnet)
++vMove (previously copied) fileDefault

Danish keyboard layout - special characters

KeyCharacter
++7\ (backslash)
+8[ (square bracket begin)
+9] (square bracket end)
+i| (pipe)
+ ¨ (to the right of “å”)~ (tilde)

FAQ

Enable Touch ID for sudo

  1. Open the Sudo PAM file:
    • In iTerm2, run the following command to edit the sudo configuration file using the vi editor:
      sudo vi /etc/pam.d/sudo
      
      Shell
      You will need to enter your password one last time to use sudo vi.
  2. Add the Touch ID line:
    • Once in the vi editor, press i to enter Insert Mode.
    • Add the following line to the very top of the file:
      auth sufficient pam_tid.so
      
  3. Save and Exit:
    • Press the ␛ key to exit Insert Mode.
    • Type :wq and press ⏎ to write the changes and quit the editor.
  4. Quit and restart the terminal emulator for the changes to take effect.

Delete local Time Machine snapshots to free up space

These can quickly fill up the drive if the external drive is often disconnected.

tmutil listlocalsnapshotdates 
Shell

If you see a list of backups sorted by date, here’s how to delete them:

tmutil deletelocalsnapshots XXXXXXX
Shell

Replace XXXXXXX with the name of one of the backups listed above, then press Return. Repeat this for as many of the local backups as you want to remove. Once you’re done, check back in the Storage tab to see how much space you’ve reclaimed. Don’t delete your local copies if you think you might need them in the future.

Send notification from the command line

Simple

osascript -e 'display notification "Your notification message here" with title "Your Title"'
Shell

With subtitle and custom sound

osascript -e 'display notification "The long-running task has finished successfully!" with title "Process Complete" subtitle "Your Script Name" sound name "Frog"'
Shell