Some commandlinefu.com favorites

There are worse things I could be doing with my time than sifting through commandlinefu.com, looking for diamonds among the diamonds. I have a few favorites, although the word “favorite” doesn’t really make sense here; it’s more like a list of commands that, after discovering them, I’ve become emotionally attached to. In other words, these are the ones I tend to re-use most often.

sudo !!

Now to be perfectly honest, I knew this one long before I saw it at the top of that stack, so maybe it doesn’t count. In the days when I was shifting from Ubuntu to Arch, this became exceptionally helpful — and it still does. To be painfully honest, I don’t use sudo much when I’m using Arch or Crux, and so any time I jump back to Ubuntu, I find myself relying on this again.

Regardless of your opinion on the whole root-vs-sudo affair, it’s good to know that you can save yourself a little time with sudo-double-bang.

cp filename{,.bak}

This is a miracle time saver. For as many times as I’ve wanted to just duplicate a file without taking the time to type the file name over again, or tell a cumbersome graphical file manager to copy and then past the same thing … this is perfect. No more keystrokes than it takes to type out the name anyway (hooray for tab completion), plus four or five extra. Genius.

!whatever:p

With or without the :p trailer, this is a useful command. I use CTRL+R a lot to search backwards through my command history, but this is actually quicker, if I’m certain I know what that last command was.

I suppose that’s where the :p trailer comes in after all: If I’m not sure I’m grabbing the right command, I can at least check first, before executing the wrong thing. Oh, and notice that there’s no space between the “whatever” and the :p. For a little while there, I thought my system was broken. …

I’m not going to bother trickling through any others, because the site itself does a better job than I can. And if you want to know the how and why, it’s worth looking at Peter Krumins’ blog, which breaks many of them apart and inspects their shiny parts. Or something like that. … :mrgreen:

About these ads

1 Response to “Some commandlinefu.com favorites”


  1. 1 Patrick 2010/06/06 at 9:28 PM

    Another good one:

    mkdir stuff
    cd !$


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,963,425 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: