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.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.

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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

Produce a pseudo random password with given length in base 64

Terminal - Produce a pseudo random password with given length in base 64
date +%s | sha256sum | base64 | head -c <length>; echo
2010-04-30 22:05:11
User: markdrago
Functions: date head
Produce a pseudo random password with given length in base 64


There is 1 alternative - vote for the best!

Terminal - Alternatives
openssl rand -base64 <length>
2010-05-01 13:09:42
User: buzzy

Don't copy trailing '=' or use head -c to limit to desired length.

perl -MDigest::SHA -e 'print substr( Digest::SHA::sha256_base64( time() ), 0, $ARGV[0] ) . "\n"' <length>
2010-04-30 21:45:46
User: udog
Functions: perl

Of course you will have to install Digest::SHA and perl before this will work :)

Maximum length is 43 for SHA256. If you need more, use SHA512 or the hexadecimal form: sha256_hex()

Know a better way?

If you can do better, submit your command here.

What others think

uncomplicated, effective and understandable to even a novice. this is the caliber what commandlinefu should asipre to when posting commands.

Comment by vxbinaca 365 weeks and 1 day ago

This is a risky command: if someone, more or less, knows when you used this command he can easy brute force your password... Don't use it.

Comment by buzzy 365 weeks ago

The date isn't random. This is stupid.

Comment by Carpetsmoker 131 weeks and 3 days ago

Don't use this. The title is technically correct, but a "pseudo random password" is not a very good password.

Comment by tlrobinson84 11 weeks and 2 days ago

Your point of view

You must be signed in to comment.