matt ryall’s weblog

Serving ones and zeroes since 2002.

Site

Portrait of Matt Ryall

 

About me

Feed icon Articles feed

Feed icon Comments feed

Archive

Photography

Europe trip 2004

More photos

Software

NoteWiki

Other Pages

About Me

Uni timetable

SysProg Journal

The List

Bash history shortcuts

6 July 2008

Many people who sit with me at a computer have questions about the strange incantations that I type into the terminal. I often use shell techniques like grabbing the last argument to the previous command:

$ ls ~/src/atlassian/confluence/trunk
$ cd !$

Or using the output of the last command as an argument to this one:

$ find . -name ConfluenceActionSupport.properties
$ vi `!!`

Two weeks ago, if you wanted to understand how this works, I would have referred you to the man page, and showed you the two or three tricks I know. But now, Allan Odgaard has written a thorough and very readable article on the subject: Working with history in bash.

I won’t try to summarise it here. If you’re interested in improving your bash fu, be sure to read it.

 
Posted by Chris Broadfoot at 2008-07-07 11:32:47
 
Posted by Matt Ryall at 2008-07-07 12:43:54
Thanks, Chris. Lots of great tips in that hefty PDF. :)
 

Comments on this article have been closed.