sudo !!
('bang bang')sudo
makes your system execute it with superuser privileges. But when you forget to sudo
, the !!
or 'bang bang' comes to the rescue. When you've perfectly crafted a long command that does exactly what you need, hit Enter, and d'oh—you don't have sufficient access privileges—you can sudo !!
to repeat the last command with superuser privileges. It's the ultimate nerd triumph: 'Oh, you didn't like that command? Well, then sudo !!
'mkdir
mkdir The BeatlesWhite AlbumDisc 1
grep
grep
comes in. Need to manually kill a faltering Thunderbird? Punch in ps aux | grep bird
, and you'll get back the specific number to kill
. Need to know which files don't have your company name in them? grep -v DataCorp *.doc
. Programmer Eric Wendelin explains grep
more in-depth.man
(and more)man
before the command (as in man ssh
) and you'll get manual-style pages detailing how to use the command. Bit too much material to process? Try whatis
for a brief description, --help
after the command for basic usage, or any of these other command-line learning tools.top
top
command to track and kill runaway processes making your system unstable. There's also ps -aux
for a single-screen, non-updating look at what's bugging your computer.wget
for powerful file-grabbingwget
command has been around since before there was all that much stuff to actually yank from the net, but this extensible, multi-purpose tool has lots of great uses these days. You can mirror entire web sites locally, resume huge downloads on the flakiest of connections, download the same file every hour to keep tabs on a project, and do much, much more with wget. It's one of those elegantly simple tools that's only as powerful as your creativity.find
find
can be in, well, finding files and directories that match the smallest criteria you can imagine. Want a list of every HTML file that references the hexidecimal color #FF0000 (red)? find
can totally do that for you. As Wendelin points out, find
, by itself, is about as convenient and powerful as a total-system searcher like Google Desktop or Quicksilver, but piped into and out of other tools like grep
, it's a powerhouse. For a more pared-down look at some of find
's powers, check out this tutorial at Debian/Ubuntu Tips & Tricks.rsync
rsync
, the flexible, powerful command that makes one folder (on your system) look like another (where you back up). To put it simply, rsync is a cross-platform, completely free Time Machine, if you use it right. Luckily, Gina's already shown us how to do that.history
, make aliases for themhistory|awk '{print $2}'|awk 'BEGIN {FS='|'} {print $1}'|sort|uniq -c|sort -r
history
—and you can start creating aliases to shorten them and make them easy to remember. Or you could search through your recently-used commands with as-you-type results for quick-fire repeats.