Warning this article may contain opinions of the author that you and iTWire don't necessarily agree with. Don't let them get away with it - have your say with a comment!

No. 1 Story

ACCC clears Optus to scrap HFC network and use NBN instead

The ACCC has cleared, provisionally, the proposed deal between Optus and NBN Co under which Optus is to be paid around $800m to shut down its HFC network and transfer customers onto the NBN. read more

Become a Linux command line black-belt

Opinion and Analysis

!whatever:p, sudo !!, ^foo^bar ... if they whet your appetite and set your pulse racing do I have a web site for you! It’s the Digg or Reddit of the Linux command-line world.

Command-line-fu is a beta web site which brings the social network ranking style of popular sites Digg and Reddit to the scenario of Linux commands.

Users and admins alike list their clever and useful commands which are then voted up or down by other readers, providing a community-moderated guide to what really is cool and clever and, most importantly, filtering out commands that are destructive or not that clever or which don’t actually work.

The items I listed above are some of the current top-ranked commands.

!whatever:p
can be used to retrieve a previously executed command from your history but avoids running it.

Most Linux users will know that prefacing a command with the exclamation point – eg !ps – will re-call the most recent command that began with those series of letters.

Yet, you might not feel safe doing this, depending on the nature of the command and particularly if you’re logged in as the superuser.

Appending the :p moderator will retrieve the command but simply display it, not execute it, allowing you to review it and adjust it if need be. Nice.

In a similar vein
sudo !!
will bring back your immediate last command but execute it as the superuser. That’s handy for when you fire up a shell, run a command and then realise immediately it failed because you forgot to prefix sudo first. Using sudo !! you can save a load of typing; just re-run the last command right away as the superuser.

This is presently the most popular command on the site indicating a lot of people find themself in that very situation – running superuser commands as an ordinary user. Hey, it’s a lot better than the situation most Microsoft Windows’ users find themselves in – running ordinary commands as the administrator!

Now, here’s one which surprised me; with almost 20 years’ UNIX and Linux under my belt I never realised it existed ever before!