Skip to main content
  1. Refs/

CLI Shortcuts

··2 mins

Configuration #

  • Remapping ctrl and caps lock makes hitting ctrl less of a stretch for the left pinky
    • System Preferences > Keyboard > Modifier Keys
      On Mac, open System Preferences > Keyboard > Modifier Keys
    • Swap Caps Lock and Control keys
      Swap the Caps Lock (⇪) Key and the Control (^) Key

Screen manipulation #

  • ctrl l - clears the screen and redraws the current line at top of screen (like clear command, except you keep your current input)
  • command t - new tab
  • command w - close tab
  • command 1 - switch to tab number 1 (can use any number)
  • command + - make fonts bigger
  • command - - make fonts smaller

Command manipulation #

  • option arrows - jump words left and right instead of single characters
  • option backspace - delete an entire word to the left of the cursor
  • option click - move cursor to wherever you click
  • ctrl a - move to the beginning of the line
  • ctrl e - move to the end of the line
  • ctrl r - reverse search history
  • ctrl u - clear line
  • ctrl k - clear line (after cursor)
  • ctrl y - insert most recently deleted text at the cursor
  • !! - (bang bang, or double bang) repeat previous command
  • sudo !! - (sudo bang bang) repeat previous command with sudo
  • !100 - (bang 100) re-execute history item #100
  • cd - move to home folder
  • cd ~ - (cd home) move to home folder
  • cd - - (cd minus) move to previous folder

Editing #

  • ctrl z - move current app to background
  • fg - restore app to foreground

References #