Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrhorn424/7036adc1f55c1513b2f2 to your computer and use it in GitHub Desktop.
Save jrhorn424/7036adc1f55c1513b2f2 to your computer and use it in GitHub Desktop.

Command Line Tricks

  • !! Repeat Previous Command
  • !-1 Repeat Previous Command
  • !-2 Repeat 2nd Previous Command
  • !ps Execute Previous Command STARTING WITH ps
  • !^ First Argument From Previous Command
  • !:2 2nd Argument From Previous Command
  • !$ Last Argument From Previous Command
  • !!:$ Last Argument From Previous Command
  • !-2:$ Last Argument From 2nd Previous Commands

Jump Commands

  • ctrl+x ctrl+e Edit the current command in editor
  • ctrl+k Kill to end of line
  • ctrl+u Clear line
  • ctrl+y Yank it back
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment