Hide

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.
Hide

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:

Hide

News

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!
Hide

Top Tags

Hide

Functions

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

convert unixtime to human-readable with awk

Terminal - convert unixtime to human-readable with awk
echo 1234567890 | awk '{ print strftime("%c", $0); }'
2009-08-25 09:37:54
User: alvinx
Functions: awk echo
7
convert unixtime to human-readable with awk

- convert unixtime to human-readable with awk

- useful to read logfiles with unix-timestamps, f.e. squid-log:

sudo tail -f /var/log/squid3/access.log | awk '{ print strftime("%c ", $1) $0; }

Alternatives

There are 2 alternatives - vote for the best!

Terminal - Alternatives
date -d @1234567890
perl -e 'print scalar(gmtime(1234567890)), "\n"'
date -r 1390196676
2014-09-24 10:33:16
User: MacMladen
Functions: date
1

Mac have direct conversion of seconds (Epoch time)

echo "0t${currentEpoch}=Y" | /usr/bin/adb
2009-08-25 12:17:01
User: verboEse
Functions: echo
0

this works on Solaris, so not better than the "only-GNU"-tool :-(

I think, there is no one-liner for this, that will work on all *nix-es

perl -le 'print scalar gmtime shift' 1234567890
2011-11-16 18:37:11
User: kimmel
Functions: perl
0

convert a unix timestamp to a human readable format.

Know a better way?

If you can do better, submit your command here.

What others think

As an matter, glance at the Quartz Rectangular Example Observe that has a wealthy, brownish wash rag wedding band. This is a view you are going to would like inside your series since it picks every thing. This unhurried all-natural leather group causes it to be a first-rate great for doldrums denim jeans and dress-down days and nights. However their silver-tone scenarios along with charm (obtaining the name MK) ensure it is classy well suited for work. It displays the silver-tone switch operated by a great Oriental quarta movement motion. It offers Arabic characters at Three:50, Half-dozen:50, Nine:Double zero as well as 14:00 and directory tagging pencils with the many other particular person hours signifies. The band assesses 7 inches very long through 24mm big. It really is water-resistant to be able to A hundred sixty five foot.Michael Kors BagsA completely new peculiarities in the human body knowledge, the automobile rushing appointments Site have really nudged Newcastle's Northumberland Platter in to the initial day of This summer where there could possibly not always be created very much great approach to begin the treatment of the fantastic deals connected with month's off of motorway car or truck rushing. Few left over obstacles need to certainly since significantly aggressive on account of the fact that your 'Pitmen's Derby' that period's race is often absolutely no exemption for you to considering that comfortable principle.When the idea refer to wristwatches, there aren't many reports into a Bags Site Ceramic Watch. Besides is the brand name linked to bills as well as stability, a new Porcelain Enjoy will be understood with regard to drawing target on the forearms of top super stars as well as The movies stars.David Allen has truly defined know-how connected with Handbags examines. He has actually operated inside view company which include brand brands including things like DKNY timepieces, Imagine timepieces plus a good deal of more view brand names.Several individualities prefer the delicate Watches Store fashion, these kind of composed of Hollywood super megastars such as Jennifer Lopez, Heidi Klum, Catherine Zeta-Jones along with Jennifer Gather that got benefit from a great Kors personalized wedding dress any time giving the Academy Awards in the year 2006. This infamously sophisticated Mrs . Barack obama put a new black color change damages the really 1st sizeable photographs cloned the woman's man was picked the new United talk about Go associated with talk about. This character types experience the increased nevertheless critical status contributed inside dress as well as the brand name features in which part of high quality with a relaxeded, secure feel.Lots of oldsters like to take a trip in addition to acquire escapes to help amazing parts. Nevertheless, locating the optimal family vacation area is just the principal help using an exceptional getaway. It's also fundamental to develop the correct travel bag combined around the ideal holiday break, whether or not these journey bags possibly be travel luggage, briefcases, handbags, as well as knapsacks. Every one of the journey bags that is to be discussed in this short report both are elegant along with throbbing headache absolutely free, excellent for type of family vacation.If you intend to purchase affordable Bags, use the buying subjugate. Amidst these individuals will use a great option of needing a duplicate as a substitute when compared to the genuine issue. Even now, that's ones design and style, the various various other ideas are usually somewhat valuable and definately will absolutely certainly obtain you the bags you desire in a fee you might take care of.With the opportunity of the actual very well truly worth of economic striking $3.Sixty three zillion, good quality look at http://www.hermesbeltsbirkinkellybag.co.uk/ outs Michael's convenience. There'll surely build up 41.7 100 shares worth $17 for you to $19 every discuss although stocks is going to be provided within a a variety of vogue craze. Kors certainly will possibly be lowering the portion of business by means of giving 5.Eight numerous 500 gives you. Agency businessman, Sportswear Assets Limited, may furthermore offer 25.Being unfaithful $ 100 or so gives. At present their part of the business demands Fifty two % and they will definitely be quiting Fourteen percent.

Comment by stephanieg915 1 day ago

Your point of view

You must be signed in to comment.