Technology news and Jobs
VIRTUALISATION
Become a Linux command line black-belt
VIRTUALISATION
Become a Linux command line black-belt | Become a Linux command line black-belt |
|
| by David M Williams | |
| Sunday, 08 March 2009 | |
|
Page 1 of 3
!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.
Featured Whitepaper
5 Best Practices for Smartphone Support
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! |
| < Next story in category | Previous story in the category > |
|---|









