|
|
Tim Toady
This is indeed a useful trick but ...you can just hit the up key [roll back to previous command(s)], jump to the beginning of the line [Emacs keybindings: ctrl+A for beginning, ctrl+E for end, etc], type "sudo " and hit enter. The big timesaver there is the [UP] [ctrl+A] combo: you can scoll back any number of commands, add the sudo prefix, and while you're at it you can make any minor edits to the command too.
That said, this isn't all that different from the original trick. Both of them work out to 5+3 keystrokes ('sudo " plus either [shift 1 1] or [up control A]). The scrolling through history trick I describe makes it easy to see what you're [re]executing, but the exclamation points hack is actually much more subtle than this. I personally haven't really pushed it, but it's possible to use your command history interactively -- such as repeating the last "grep" command, even if it was some time yesterday. The tcsh man page goes over this, but I also recommend taking a look at O'Reilly's Unix Power Tools. It has a big section on the different shells & how they can be leveraged. There's also the csh/tcsh book, but the Power Tools one covers *everything*, so if you get stuck on a Linux machine and have to use Bash you'll be able to look up the trickery there too :-) |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|