skip to content
Alvin Lucillo

Bring prev command to terminal

/ 1 min read

💻 Tech

If you have a command from your history, just take its number and enter something like this in the terminal: !123:p. For full steps:

  1. Determine the history number (run here is a substring of a command you’re searching for): history | grep run
  2. It will show something like:
  122  git push
  123  k run nginx --image=nginx
  124  k delete po/nginx
  1. Bring command with history number 123 to the terminal: !123:p
  2. Your terminal will show:
k run nginx --image=nginx