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 usesudo
→sudo !!
- Similarly
!$
uses last command’s output for a new command, e.g.ls foo*
followed byrm !$
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
.