Tip 16: Fast command history in bash

From Vlsiwiki
Jump to: navigation, search

Run the last command again:

!!

Run command 423 in your history buffer (type history to see the list):

!423

Run the last command that starts with grep:

!grep

Run the last command but substitute the first occurence of arg1 with arg2:

^arg1^arg2

Run the last command but substitute ALL occurences of arg1 with arg2:

!:gs/arg1/arg2/