As you probably already know, I have been trying to live more on the command line these days. I’ve been using Pine as my primary email client and doing most of my file management with command line tools, and stuff like Midnight Commander. I have been also toying with the idea of switching to a tiling window manager, but it’s been hard to wean myself off KDE. Still, this exercise has been especially fun when dealing with co-workers who have never experienced the subtle magic of command line lifestyle.
Recently a coworker received a 7z archive in the email. Being a clueless techno muggle he did the only thing that seemed reasonable in that situation. He completely ignored the help desk, and the approved channels and instead emailed it to one of the developers (namely me) with a note along the lines of “Please open and email it back to me ASAP, this is mission critical stuff!!!1″. Why? Because that’s what programmers do, right? They unzip the files when needed and browse the web the rest of the time. To add insult to the injury, he also wandered over to my desk and did the whole “Didja get that thing I sent ya?” thing from Harvey Birdman.
Once I ascertained I can actually un-zip and re-zip the file (as a regular zip) for him faster than explain to him why he shouldn’t bother me with this I decided to put on a little show and do it all without ever touching the mouse.
Since I was already in Tmux working on something in vim I hit Ctrl+Z, C to open a new pane. I changed the default Ctrl+B command because Z is much easier to reach. I typed in pine real fast. I have it configured to execute the i command on start-up so it went straight into my email. His message happened to be the most recent one so I just hit Enter to open it and V to open the attachment view.
From there I hit S to save the attachment to my home directory and Enter to confirm it. I hit Ctrl+Z, | to split Tmux screen in half (yet another custom keystroke I set up to make Tmux actions easier to remember) and typed in mc to open Midnight Commander because the file had like a mile long name with 37 spaces in it and I wanted to do it fast. I quickly located the file, and picked inside with mc to confirm it will extract to its own directory (instead of dumping a lot of junk into my home folder) and hit F2, @ and typed in:
The file unzipped just fine, so I hit F8 to delete the 7z archive, and used Midnight Commander’s Alt+S incremental search feature to jump right onto the extracted folder. From there I once again did F2, @ and typed in:
zip -r stuff.zip
I hit F8 again to delete the folder, and without skipping a beat I typed in:
pine -attach_and_delete stuff.zip
I typed in his email, hit Ctrl+X to send, and returned to vim with Ctrl+Z, 1. Then I turned around very slowly, put hands behind my head and said: “Done.”
His reaction was along the lines of:
I actually had to do a little bit of convincing to make him believe I actually managed to “magic” his file into usable format without ever opening Outlook, or using WinZip. And yes, we actually pay for a few dozen WinZip licenses simply because despite many hours of training, and countless memos a lot of our users can’t wrap their heads around Send To –> Compressed Zipped Folder context menu in Windows.
Was this the fastest way to do this? Probably not. I could have likely avoid a few steps and minimize my hand movement off the home row just by cutting Midnight Commander out of the equation. That said, Midnight Commander looks kinda cool when you put it side by side Pine in Tmux.
What was the last time you confused your users by doing something without touching the mouse?