commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
The arguments of "seq" indicate the starting value, step size, and the end value of the x-range. "awk" outputs (x, f(x)) pairs and pipes them to "graph", which is part of the "plotutils" package.
Displays six rows and five columns of random numbers between 0 and 1. If you need only one column, you can dispense with the "for" loop.
Another combination of seq and awk. Not very efficient, but sufficiently quick.
"seq 100" outputs 1,2,..,100, separated by newlines. awk adds them up and displays the sum.
"seq 1 2 11" outputs 1,3,..,11.
Variations:
1+3+...+(2n-1) = n^2
seq 1 2 19 | awk '{sum+=$1} END {print sum}' # displays 100
1/2 + 1/4 + ... = 1
seq 10 | awk '{sum+=1/(2**$1)} END {print sum}' # displays 0.999023
this is very useful when there is a different network host to determine which are turned on or not
Optionally, one can use {1..50} instead of seq. E.g. for i in {1..50} ; do echo Iteration $i ; done
Seq allows you to define printf like formating by specified with -f, %03g is actually tells seq I got three digits, fill the blank digits with 0, and the range is from 176 to 240.