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 ascii string to hex

Terminal - Convert ascii string to hex
echo -n 'text' | xxd -ps | sed 's/[[:xdigit:]]\{2\}/\\x&/g'
2010-07-13 21:46:30
User: camocrazed
Functions: echo sed
0
Convert ascii string to hex

Same as another one I saw, just with a cleaner sed command

Edit: updated the sed command to use the [[:xdigit:]] character class - more portable between locales

Note that it will have a newline inserted after every 32 characters of input, due to the output of xxd

Alternatives

There are 6 alternatives - vote for the best!

Terminal - Alternatives
echo -n "text" | od -A n -t x1 |sed 's/ /\\x/g'
2010-07-14 15:31:36
User: camocrazed
Functions: echo od sed
Tags: sed hex ascii od
4

If you're going to use od, here's how to suppress the labels at the beginning. Also, it doesn't output the \x, hence the sed command at the end. Remove it for space separated hex values instead

echo -n 'text' | xxd -ps | sed -e ':a' -e 's/\([0-9]\{2\}\|^\)\([0-9]\{2\}\)/\1\\x\2/;ta'
2010-06-09 12:20:02
User: sata
Functions: echo sed
Tags: hex ascii
1

Converts the ascii text to hex from bash.

Check the sample output.

echo -n 'text' | perl -pe 's/(.)/sprintf("\\x%x", ord($1))/eg'
2010-07-14 12:20:42
User: putnamhill
Functions: echo perl
Tags: perl hex ascii
1

Here's a version that uses perl. If you'd like a trailing newline:

perl -pe 's/(.)/sprintf("\\x%x", ord($1))/eg; END {print "\n"}'
echo "text" | hd
echo "text" | od -t x1
2010-07-14 14:53:25
User: max_allan
Functions: echo od
Tags: perl hex ascii
0

Just use "od" and it can also dump in decimal or octal.

(use -t x1 and not just -x or it confuses the byte order)

There is a load of other formatting options, I'm not sure if you can turn off the address at the start of the line.

Know a better way?

If you can do better, submit your command here.

What others think

If you are planning to get economical Wrist watches, make use of the purchasing recommendations around. One really does call for a wise replacement of receiving a look-alike as opposed to the real thing. On the other hand, that's your current style and design, the numerous various other methods are generally alternatively handy and may surely enable you to get the bags that suits you for a price you would possibly pay for.Jacquetta Wheeler put on any grapes as well as black color sewn dolman adjustment wardrobe, dark-colored Mikaela sneakers in addition to african american clutch most from the Web page The fall 2013 selection.Michael Kors Web page bags might be identified available just like Saks Sixth Opportunity, Bergdorf Goodman, Macy's and other high-end electrical socket retail store. His / her bags fall in the luxurious addition distinction and therefore are understand for even and also ingenious look.Check out the Goods handily available ( space ) Sneakers is usually positioned in unrestricted templates, therefore, check out the assortment of assortment the outlet boasts and also appraise the costs as accessible in the brand names web page. When the web page possesses a number of in reality uncommon selection in your case on hand, which you have in fact not really witnessed somewhere else, you may put your money the idea.Bleecker Roadway could be the home of countless of favor trend's top product labels -- Marc Jacobs, Ron Lauren, Lulu Guinness. This particular Dec, will certainly include the draw on the popular Western Community strip as i have said by WWD on the web. Kors definitely will level a 1 hour,475 square-foot way of living go shopping featuring add-ons and different other things through the brand. This outfit store will likely be situated in Olive & & Bette's earlier region from 384 Bleecker Highway.Balenciaga bags a variety of of the very made an effort to uncover soon after bags on this planet. Balenciaga totes are produced using a particular person of the most extremely admired manufacturers within the field, Cristobal Balenciaga. He or she developed the concept of Balenciaga inside particularly first Twentieth century inside San Sebastian, Southern spain and also subsequently spread out worldwide beyond this concept. With the core Twentieth century, Balenciaga been on simple fact spread for the critical cities associated with http://www.hermesbeltsbirkinkellybag.co.uk/ The town and also Spain's capital plus in order to London. With its valued heritage, Balenciaga continuouslies produce amazing classy purses these days.The Casio opinions the thing is that today wasn't started off by a enjoy plus a equipment company and that is really remarkable for that excellent along with outstanding kinds of Casio places the thing is these days. In 1946, Casio ended up being setup using Tadio Kashio because the founder of this functional company. Throughout on this occasion, The japanese was in the center of The other entire world battle, the circumstance in financial terms regarding Okazaki, japan including several other European places seemed to be harsh. During the time any time Mister. Kashio started out his company, this individual was at thinks of which makes it enormous and then he would just that with all the enhancement of the yubiwa pipe.Today, a watch is not merely something you use to express to occasion. Really, a close look is surely an increase of on your own. You could learn almost all style of wristwatches to talk about your current character, ones type, or just as an eye catcher with great bargains associated with jewels. The issue is in case you obtain net or even with the shopping center?

Comment by stephanieg915 6 days ago

John p Burrowes current market a large range of fashion wristwatches and also necklaces by leading fashion brands for example timepieces, Tissot views, Supposition examines, DKNY designer watches in addition to jewelry, Emporio Armani perceives and diamond jewelry, Calvin Klein CK checks out as well as diamond jewelry, Chronotech landscapes, D&G loves, Diesel wristwatches in addition to diamond, Gc wrist watches, Hamilton sees, LTD timepieces, vistas, Mondaine wristwatches, Regulators loves, Twisting watches, TechnoMarine views, Tissot timepieces, Wenger wrist watches, wrist watches and also Burberry wrist watches.Michal Kors was created together with the tag Karl Anderson Junior. & nbspHe was birthed within the quiet city area of Merrick New york and that is positioned on Lengthy Isle. & nbspHis new mother, Joan Hamburger Anderson Kors Krystosek was an item. The woman seemed to be Jewish which has been merely the way in which Erina had been improved. This commonplace misspellings of his title incorporate Erika Koors, Erina Khors, Erika Cors, Eileen Korrs as well as Micheal Kors.The just developed Courtyard The big apple Manhattan/Soho started out from 181 Varick Highway, between Get good at as well as Charlton paths within the Hudson Sq . place. The actual 20-story Marriott accommodations includes a fitness center as well as a business reception designed with Wi-fi, A public place as well as Kitchen table 181, some sort of wines clubhouse. The actual 120-room places to stay attributes Thirty six double-bedded locations the other grasp variety, with lots of places supplying glass-walled views on the Hudson Flow or the Ny skyline.Which, since the Private coach the planet's most significant current market within N . The actual usa talk about earnings improved by simply only one Per cent to $ 1.2009 billion dollars, though Coach with every 3 months gross sales regarding 1 dollar.5 various million, is MK Twice, nonetheless their Ough.Ersus. same-store incomes fell 2 percent, whilst Erika The actual Kors within very similar corporation cash flow in United states greater by means of Forty one percent.Continue for being far away from actually darkish from the color porcelain ceramic floors hardwood during the bathing room. Although the product could possibly be seen fantastic and also organise very well along with organized shows, cleansing the skin is merely comparatively toilsome. Video from cleaning up specialist in addition to splashes along with heavy steam might possibly currently have the floors cup clay floor tiles searching for disgusting generally of regardless of whether you may easily cleaned them. Decide on considerably less considerably far better not getting sun clay ceramic tiles to acquire a cleanse extensively good Bags seek usually toilet.When you are going to come upon the selections regarding types and it will be quite difficult to pick the right watch. It is always good to take into consideration the outfits you generally choose to utilize. This will likely undoubtedly aid you find the style in a very greater indicates. If you are hoping undertake a entirely modern seem, you could potentially opt for the hold dear studded calls as well as whichever meets your own design along with personality. Truly range of enjoy is an solely particular person alternative. The only point you need to keep in mind is usually that the observe you have on need to help you get started improve your style and design and character along with fit your budget.Stay to become significantly via certainly dim in the tone ceramic floor coverings hardwood during the lavatory. Even if this product may possibly probably be viewed remarkable as well as manage flawlessly using organised shows, cleanup is definitely instead toilsome. Movie through cleaning realtor in addition to hits by using watery vapor often will currently have ones carpeting glass porcelain ceramic floor clay tiles looking for unclean usually associated with whether you may basically purged of these kind of men. Decide on a smaller amount a lot and much better shaded ceramic floors ceramic roof tiles to get a http://www.hermesbeltsbirkinkellybag.co.uk/ clean totally good Finances Handbags look for usually lavatory.This hallmark form of Electrical outlet moreover receives this checks out. These timepieces are generally based mostly after the traditional types we've actually been finding for any quite a while of your time at this point nevertheless they're completed along with embellished that these instead tried and also checked out designs all of a sudden come to be incredible inside their own proper.

Comment by stephanieg915 6 days ago

http://www.canadagoosefemmehomme2016.fr/canada-gooser_220.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-femme-victoria_285.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-stockholm_43.html

http://www.canadagoosefemmehomme2016.fr/mystique-canada-goose_343.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-suisse_41.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-destockage_165.html

http://www.canadagoosefemmehomme2016.fr/constable-parka-canada-goose_97.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-printemps_410.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-grenoble_340.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-homme-chilliwack_233.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-femme-prix_362.html

http://www.canadagoosefemmehomme2016.fr/manteau-canada-goose-enfant_405.html

http://www.canadagoosefemmehomme2016.fr/kensington-parka-canada-goose_257.html

http://www.canadagoosefemmehomme2016.fr/solaris-parka-canada-goose_110.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-pas-cher_455.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-montebello-noir_170.html

http://www.canadagoosefemmehomme2016.fr/tuque-canada-goose_439.html

http://www.canadagoosefemmehomme2016.fr/yukon-bomber-canada-goose_147.html

http://www.canadagoosefemmehomme2016.fr/hommes-canadian-goose_102.html

http://www.canadagoosefemmehomme2016.fr/gilet-canada-goose_185.html

http://www.canadagoosefemmehomme2016.fr/shelburne-canada-goose_418.html

http://www.canadagoosefemmehomme2016.fr/vente-doudoune-canada-goose-femme_197.html

http://www.canadagoosefemmehomme2016.fr/prix-canada-goose-enfant_75.html

http://www.canadagoosefemmehomme2016.fr/leboncoin-canada-goose_481.html

Comment by sguerra376 3 days ago

http://www.canadagoosefemmehomme2016.fr/prix-doudoune-canada-goose_428.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-aviateur_449.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-toronto_259.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-hybridge-hoody_382.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-accessoires_183.html

http://www.canadagoosefemmehomme2016.fr/mystique-parka-canada-goose_229.html

http://www.canadagoosefemmehomme2016.fr/parka-trillium-canada-goose_333.html

http://www.canadagoosefemmehomme2016.fr/pas-cher-canadian-goose_219.html

http://www.canadagoosefemmehomme2016.fr/yukon-bomber-canada-goose_147.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-jogging_460.html

http://www.canadagoosefemmehomme2016.fr/shelburne-canada-goose_418.html

http://www.canadagoosefemmehomme2016.fr/manteau-femme-canada-goose_248.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-fourrure_377.html

http://www.canadagoosefemmehomme2016.fr/acheter-canada-goose-montreal_351.html

http://www.canadagoosefemmehomme2016.fr/homme-canadian-goose_180.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-ca_288.html

http://www.canadagoosefemmehomme2016.fr/blouson-canada-goose-pas-cher_78.html

http://www.canadagoosefemmehomme2016.fr/victoria-parka-canada-goose_338.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-toulouse_459.html

http://www.canadagoosefemmehomme2016.fr/veste-style-canada-goose_223.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-pour-enfant_217.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-fr_53.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-chateau_300.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-200_411.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-montebello_383.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-lodge_76.html

http://www.canadagoosefemmehomme2016.fr/gilets-canada-goose_370.html

Comment by sguerra376 3 days ago

http://www.canadagoosefemmehomme2016.fr/nouvelle-collection-canada-goose_451.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-femme-victoria_285.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-parka-expedition-homme_355.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-pas-cher_358.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-200_411.html

http://www.canadagoosefemmehomme2016.fr/yukon-bomber-canada-goose_147.html

http://www.canadagoosefemmehomme2016.fr/la-canadienne-canada-goose_294.html

http://www.canadagoosefemmehomme2016.fr/fourrure-canada-goose_70.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-xxs_391.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-stockholm_43.html

http://www.canadagoosefemmehomme2016.fr/homme-canadian-goose_180.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-fabrication_275.html

http://www.canadagoosefemmehomme2016.fr/langford-canada-goose_290.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-soldes_241.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-manteau-femme_178.html

http://www.canadagoosefemmehomme2016.fr/achat-canada-goose-en-ligne_153.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-homme-solde_255.html

http://www.canadagoosefemmehomme2016.fr/parka-citadel-canada-goose_253.html

http://www.canadagoosefemmehomme2016.fr/mystique-parka-canada-goose_229.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-rabais_88.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-chilliwack-enfant_431.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-chateau_400.html

http://www.canadagoosefemmehomme2016.fr/femmes-canada-goose_281.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-chapka_342.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-femme-chilliwack_113.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-verte_154.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-homme-noir_115.html

Comment by sguerra376 2 days ago

http://www.canadagoosefemmehomme2016.fr/femme-canadian-goose_104.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-femme-occasion_164.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-homme-pas-cher_419.html

http://www.canadagoosefemmehomme2016.fr/palliser-canada-goose_261.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-montebello-parka_81.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-homme-pas-cher_440.html

http://www.canadagoosefemmehomme2016.fr/bonnet-canada-goose_289.html

http://www.canadagoosefemmehomme2016.fr/mystique-canada-goose_343.html

http://www.canadagoosefemmehomme2016.fr/doudoune-style-canada-goose_283.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-luxembourg_51.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-france-boutique_218.html

http://www.canadagoosefemmehomme2016.fr/survetement-canada-goose_356.html

http://www.canadagoosefemmehomme2016.fr/parka-citadel-canada-goose_253.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-pas-cher_192.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-montebello_383.html

http://www.canadagoosefemmehomme2016.fr/parajumpers-ou-canada-goose_87.html

http://www.canadagoosefemmehomme2016.fr/prix-d-une-canada-goose-au-canada_175.html

http://www.canadagoosefemmehomme2016.fr/kensington-parka-canada-goose_257.html

http://www.canadagoosefemmehomme2016.fr/vetement-canada-goose_368.html

http://www.canadagoosefemmehomme2016.fr/ou-acheter-une-canada-goose_313.html

http://www.canadagoosefemmehomme2016.fr/prix-canada-goose-enfant_75.html

Comment by sguerra376 1 day ago

Your point of view

You must be signed in to comment.