Link to this headingBash

Link to this headingBang Commands

Replace the command but keep the same arguments:

>>> echo a b c d e f a b c d e f >>> echo !* echo a b c d e f a b c d e f

Replace only the first argument:

cat filename arg1 test2 nvim !*

Run the command in line 54 of the Bash History:

!54

Run the last command with a find and replace:

>>> echo aaa aaa >>> ^aaa^bbb echo bbb bbb

Run the last command with a find and replace all:

>>> echo aaaaaaaaa aaaaaaaaa >>> !!:gs/aaa/bbb/ echo bbbbbbbbb bbbbbbbbb