If you’ve spent enough time messing around in Terminal, you’ll know one thing for sure: re-typing the stuff you’ve laboriously typed in with only minor differences is tedious. And it happens more often than we’d like.
The Terminal does, however, keep a history of all the commands you’ve typed into it. To see this in action, you can cycle through the last few commands you’ve typed in, simply hit the arrow keys up or down when in Terminal.
There are a few more less intuitive commands to make the best use of your Terminal history, however.