

How little you know, and some useful commands. - nwilkens
http://www.mnxsolutions.com/quick-tip/how-little-you-know-and-some-useful-commands-for-the-week.html

======
shubber
My favorite bash trick is still Ctrl-O: submit command and advance history by
one.

If you ever find yourself counting up-arrows to repeat a sequence of commands
(that aren't worth scripting for whatever reason), next time, go to the top of
the list and hit Ctrl-O. The result is the the command runs, and the one after
it in the history is loaded into you prompt.

------
tenaciousJk
Watching Star Wars via telnet... I've been looking for that command for ages.

------
nlo
Within the past year I discovered dig's +short parameter, which let me retire
some scripts I had for parsing just the IPs out of dig's output. e.g.:

dig +short google.com

~~~
shii
Yeah +short is pretty cash. I alias this[1] little magic glue to wiki and use
that a lot instead of wasting precious milisecs on HTML and silly styling.

[1]: [http://www.commandlinefu.com/commands/view/2829/query-
wikipe...](http://www.commandlinefu.com/commands/view/2829/query-wikipedia-
via-console-over-dns)

------
ajays
The "@" command is pretty useful too, for doing arithmetic on shell variables.

    
    
        % set i = 1
        % echo $i
        1
        % @ i++
        % echo $i
        2
        % @ i *= 2
        % echo $i
        4

~~~
Nick_C
Which shell? (@ is not in my bash version, nor spaces around the = sign.)

~~~
zbyszek
tcsh

------
thangalin
Bad example:

    
    
        $ ls -l 500.*
        $ ^500^600
    

Fewer keystrokes (using bash):

    
    
        $ ls -l 500.*
        Up-arrow, control-left, delete, 6

------
Estragon
Ctrl-X E didn't work for me. Anyone know what shell that's for? (I'm using
bash.)

~~~
nwilkens
That was bash, Try Cntrl-X Cntrl-E instead.

~~~
Estragon
Wow, that is super cool.

------
dsakima
Ctrl+r instead of history | grep

