Command Management

Summary

This note is a quick reference for command history and command reuse in the shell. These shortcuts are small, but they save a lot of time once you start working in the terminal every day.

Commands

CommandPurpose
historyshow command history
!!repeat the previous command
!2run the command with history number 2

Example usage

history
!2
!!

Notes

  • !! is useful, but also dangerous if you do not remember the exact previous command
  • history is the safer first step when you are unsure what you ran earlier