What's this?

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.

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

Stay in the loop…

Follow the Tweets.

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.

This will calculate a running standard deviation in one pass and should never have the possibility for overflow that can happen with other implementations. I suppose there is a potential for underflow in the corner case where the deltas are small or the values themselves are small.

Removes trailing newline; colon becomes record separator and newline becomes field separator, only the first field is ever printed. Replaces empty entries with $PWD. Also prepend relative directories (like ".") with the current directory ($PWD). Can change PWD with env(1) to get tricky in (non-Bourne) scripts.

Shell timeout variables (TMOUT) can be very liberal about what is classified as 'activity', like having an editor open. This command string will terminate the login shell for an user with more than a day's idle time.

(209.85.229.96) is ww-in-f96.google.com
(209.85.229.97) is ww-in-f97.google.com
(209.85.229.98) is ww-in-f98.google.com
(209.85.229.99) is ww-in-f99.google.com
(209.85.229.100) is ww-in-f100.google.com
(209.85.229.101) is ww-in-f101.google.com
(209.85.229.102) is ww-in-f102.google.com
(209.85.229.103) is ww-in-f103.google.com
(209.85.229.104) is ww-in-f104.google.com
(209.85.229.105) is ww-in-f105.google.com
(209.85.229.106) is ww-in-f106.google.com
(209.85.229.107) no PTR
(209.85.229.108) no PTR
(209.85.229.109) no PTR
(209.85.229.110) no PTR
(209.85.229.111) no PTR
(209.85.229.112) is ww-in-f112.google.com
(209.85.229.113) is ww-in-f113.google.com
(209.85.229.114) no PTR
(209.85.229.115) is ww-in-f115.google.com
(209.85.229.116) is ww-in-f116.google.com
(209.85.229.117) no PTR
(209.85.229.118) is ww-in-f118.google.com
(209.85.229.119) no PTR
(209.85.229.120) is ww-in-f120.google.com
(209.85.229.121) no PTR
(209.85.229.122) no PTR
(209.85.229.123) is ww-in-f123.google.com
(209.85.229.124) no PTR
(209.85.229.125) is ww-in-f125.google.com
(209.85.229.126) is ww-in-f126.google.com
(209.85.229.127) is ww-in-f127.google.com

This command uses nmap to perform reverse DNS lookups on a subnet. It produces a list of IP addresses with the corresponding PTR record for a given subnet. You can enter the subnet in CDIR notation (i.e. /24 for a Class C)). You could add "--dns-servers x.x.x.x" after the "-sL" if you need the lookups to be performed on a specific DNS server.

On some installations nmap needs sudo I believe. Also I hope awk is standard on most distros.