01/24/13 22:00:37 ¶ ●

osx - What are some tips or tricks for Terminal in Mac OS X? - Ask Different

This just killed 30 minutes of my life, but it was worth a second read. I was sure there is a way to “execute last command again” and “use the output of the previous command in this new command”. So I searched for it and found this thread.

  • !! to run last command again. Useful in combination other commands, e.g. when you have forgotten to use sudo → sudo !!
  • Similarly !$ uses last command’s output for a new command, e.g. ls foo* followed by rm !$

Don’t forget to read some of the comments as well. Really great stuff.

I’m also using the pman and tman commands in my .profile.