In the last few months i’ve come across some great little things that make using the terminal (in OSX) lots more fun. Here’s one of them…
The history command simply lists the the history of commands entered into the terminal. Used with grep this enables you to find and use previously typed commands.
mac1:~ mevans$ history | grep mysql
3 mysqld5 &
331 ps ax | grep mysql
You can then use any of these commands again using a ! - eg. !331