TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How little you know, and some useful commands.

17 pointsby nwilkensabout 14 years ago

7 comments

shubberabout 14 years ago
My favorite bash trick is still Ctrl-O: submit command and advance history by one.<p>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.
tenaciousJkabout 14 years ago
Watching Star Wars via telnet... I've been looking for that command for ages.
nloabout 14 years ago
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.:<p>dig +short google.com
评论 #2342896 未加载
ajaysabout 14 years ago
The "@" command is pretty useful too, for doing arithmetic on shell variables.<p><pre><code> % set i = 1 % echo $i 1 % @ i++ % echo $i 2 % @ i *= 2 % echo $i 4</code></pre>
评论 #2343104 未加载
thangalinabout 14 years ago
Bad example:<p><pre><code> $ ls -l 500.* $ ^500^600 </code></pre> Fewer keystrokes (using bash):<p><pre><code> $ ls -l 500.* Up-arrow, control-left, delete, 6</code></pre>
Estragonabout 14 years ago
Ctrl-X E didn't work for me. Anyone know what shell that's for? (I'm using bash.)
评论 #2342793 未加载
dsakimaabout 14 years ago
Ctrl+r instead of history | grep