What does this command do?
!g++
For the history command:
!12
It runs command #12 of the history, but what about g++
, or another:
!cat filename
What does this command do?
!g++
For the history command:
!12
It runs command #12 of the history, but what about g++
, or another:
!cat filename
See the Bash manual, "Event Designators":
This means that
!g++
runs the last command that began withg++
, calling the GNU C++ compiler:!cat filename
, on the other hands, doesn't make a lot of sense as it's already a complete command. Unless there was a super complicated pipe after that command the last time, of course, which the event designator would then repeat.