Command-Line Archive

Here’s a quick trick I’ve been using for a while, but have found that not many others know about it. It’s a way to grab the arguments from the last command you executed. Command line expansion allows you to do many things, but today we’ll focus on just argument expansion. First to simply repeat the last command with !!. This is most helpful when needing to prefix a command; with something like sudo or bundle exec.



Christopher R Marshall


Enjoys programming web applications; especially in Go and Ruby. Also enjoys playing ice hockey as a goalie and playing the guitar.