0

I am in UNIX, and what is the fastest way to get the previous command in shell? Right now I am using !:0 to get the previous command, but I am not sure if there is a better alternative. Let say I have this:

git add .
!:0 commit -m "Inital" //!:0 will be git

Is there an even faster way? !:0 is not easy to type.

John Winston
  • 1,260
  • 15
  • 30

1 Answers1

0

I use up arrow on my termianl to get the latest commands i ran, you may also use history, and to run any command from history use !.

Syed
  • 61
  • 4