The command line can be quite powerful, but typing in long commands and file paths gets tedious pretty quickly. Here are some shortcuts that will have you running long, tedious, or complex commands with just a few keystrokes.
Image remixed from an original by xkcd.
Power users love the command line for its ability to perform complicated tasks with just a few keystrokes. But for beginners who don’t know the shortcuts and type everything out longhand, it can seem like it takes forever (I know this because I’m just past beginner myself, and I still didn’t know most of these shortcuts).
These commands apply primarily to *NIX-based command lines, which, out of the box, are included on systems like OS X and Linux. To use them on Windows, install Cygwin. (We highly recommend ditching Windows’ crappy command line for Cygwin.)
From simple keyboard shortcuts to built-in shorthand to commands you can build and customize yourself, the Terminal has a ton of ways you can speed up your command line work, and here we’re going to show you some of the basics (as well some customizable features that you can use to shorten pretty much any command you want).
If you’re just getting started with the command line, we recommend you also check out our command line primer for beginners. Heck, even if you’re not a beginner, skim through it—you’re sure to find a few things you didn’t know. We’ll be touching on a few of those subjects and building on them here, too.