Seven Bash Tips

Carrying on with yesterday’s theme of Bash hackery, I present to you Ian Miell’s Seven God-Like Bash History Shortcuts You Will Actually Use. If you’re anything like me, you read one of these articles and think, “Wow! That’s really neat. I’m gonna start doing that too.” Of course, you immediately forget the shortcuts and keep doing things the way you always have. Even Miell, who wrote the book on this stuff, admits that he mostly forgets the shortcuts. He says, however, that these are shortcuts that he uses everyday and that he’s actually learned them.

You may or may not “actually use” Miell’s tips but they are handy and if you work on the command line a lot, they are definitely worth knowing. Many of the tips involve quickly changing one of the words on the last command or, perhaps, switching their order. That’s useful when you misenter one of the arguments in a long command line. Rather than retyping the whole thing, you can use one of the shortcuts to minimize the amount of retyping you need to do. There are other shortcuts for doing things like a search and replace. Take a look at Miell’s post to see what you can do.

Of course, you can always bring up the last command and use the editing capabilities of Readline that I wrote about yesterday to accomplish the same things so you might not think it’s worthwhile learning the shortcuts. If you strive to absolutely minimize the number of keystrokes you type, Miell’s shortcuts will put you a bit ahead but only a bit. My own reaction is “Wow! That’s really neat. I’m gonna start doing that too.” But I probably won’t.

This entry was posted in General and tagged , . Bookmark the permalink.