There's a great video educational series called “Head in the Clouds” that's led by Kenneth G. Hartman in collaboration with the SANS Institute. In Episode 5, “Tips for Success with Command Line Interfaces Using BASH” (source), I learned about a command that I've taken to using immediately in my day to day: the
history command. What particularly stunned me was how I could not only get a list of past commands but also run any of those commands with the
!# format. In recent memory, I've never taken to using a command so quickly as I did with
history. Why is that?
I wonder if part of it is the beauty of shorthand when faced with short-term memory. It's at the heart of why we use contacts in my phone instead of memorizing numbers, memorable domains instead of IP addresses. Remembering every command you run in the terminal is tough, but having a command that does with easy numerical shorthand? That eases the mnemonic burden.
That reminds me — a fork of a tool that I've turned to for work called ssha provides a similar service to humanity. When working with dozens of EC2 instances, it's hard to keep up with what keys associate with which instance, let alone the exact IP address of every instance. It becomes a quixotic quest of scrolling through the AWS console to find an IP address. The beauty of ssha is that it allows you to use shorthand to find you need to connect to — ssha takes your AWS credentials and runs some API calls to find the instance, know what key pair it uses, and then run the appropriate SSH command to connect you to the instance. No remembering the key, no remembering the IP address.
The mnemonic services that programs and commands like
history and ssha provide is something I've never thought about much consciously. It's been a sort of an unconscious appreciation — “Oh great, I can use less keystrokes”, “Now I don't have to remember a complicated command.” But now that it is in the forefront of my mind, I can't stop thinking about it.