I like to take notes in Simplenote to capture the steps I take on any projects that I do. Today, I was doing an install for a little project that I’m working on (which might be a future topic if it comes to anything) and wanted to capture the recent history of the command lines I had used in a format that I could just copy and paste into my notes.
I didn’t want the history numbering that comes out by default and awk seemed to be the perfect tool for the task:
$ history 5 | awk '{ $1=""; print $0 }'
This gave me the last 5 commands without the numbering. Easy peasy.