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

Encrypt and password-protect execution of any bash script

Terminal - Encrypt and password-protect execution of any bash script
echo "eval \"\$(dd if=\$0 bs=1 skip=XX 2>/dev/null|gpg -d 2>/dev/null)\"; exit" > script.secure; sed -i s:XX:$(stat -c%s script.secure): script.secure; gpg -c < script.bash >> script.secure; chmod +x script.secure
2013-03-09 11:16:48
User: rodolfoap
Functions: chmod echo gpg sed stat
5
Encrypt and password-protect execution of any bash script

(Please see sample output for usage)

script.bash is your script, which will be crypted to script.secure

script.bash --> script.secure

You can execute script.secure only if you know the password. If you die, your script dies with you.

If you modify the startup line, be careful with the offset calculation of the crypted block (the XX string).

Not difficult to make script editable (an offset-dd piped to a gpg -d piped to a vim - piped to a gpg -c directed to script.new ), but not enough space to do it on a one liner.

Alternatives

There are 2 alternatives - vote for the best!

Terminal - Alternatives
read -p 'Script: ' S && C=$S.crypt H='eval "$((dd if=$0 bs=1 skip=//|gpg -d)2>/dev/null)"; exit;' && gpg -c<$S|cat >$C <(echo $H|sed s://:$(echo "$H"|wc -c):) - <(chmod +x $C)
2013-03-10 08:59:45
User: rodolfoap
Functions: cat chmod echo gpg read sed wc
6

(Please see sample output for usage)

Use any script name (the read command gets it) and it will be encrypted with the extension .crypt, i.e.:

myscript --> myscript.crypt

You can execute myscript.crypt only if you know the password. If you die, your script dies with you.

If you modify the startup line, be careful with the offset calculation of the crypted block (the XX string).

Not difficult to make script editable (an offset-dd piped to a gpg -d piped to a vim - piped to a gpg -c directed to script.new ), but not enough space to do it on a one liner.

Sorry for the chmod on parentheses, I dont like "-" at the end.

Thanks flatcap for the subshell abbreviation to /dev/null

Know a better way?

If you can do better, submit your command here.

What others think

Nicely done !

Comment by erix 201 weeks and 6 days ago

Welcome to my Taobao shop !

Daily update:

Discover amazing stuff, collect the things you love, buy it all in one place.

novel style, varieties, low price and good quality, and the low sale price

==== ( http://www.fullmalls.com ) =====

==== ( http://www.fullmalls.com ) =====

New to Hong Kong : Winter Dress

Best quality, Best reputation , Best services

---**** NHL Jersey Woman $ 40 ---**** NFL Jersey $ 35

---**** NBA Jersey $ 34 ---**** MLB Jersey $ 35

---**** Jordan Six Ring_m $ 36 ---**** Air Yeezy_m $ 45

---**** T-Shirt_m $ 25 ---**** Jacket_m $ 36

---**** Hoody_m $ 50 ---**** Manicure Set $ 20

---**** handbag $ 37 ---**** ugg boot $ 43 ---****

give you the unexpected harvest

==== ( http://www.fullmalls.com ) =====

==== ( http://www.fullmalls.com ) =====

==== ( http://www.fullmalls.com ) =====

==== ( http://www.fullmalls.com ) =====

Comment by yeiuoisdf 201 weeks and 6 days ago

Your command is wrong.

Hint: What is script.bash?

Comment by betsubetsu 201 weeks and 6 days ago

betsu{,} : click on Sample Output with the right button of your mouse and you see how to use the command. You need some input script to encrypt, in the example, script.bash.

Comment by rodolfoap 201 weeks and 6 days ago

very good, I like it

Comment by liuwei000000 201 weeks and 1 day ago

I love bags! There are many varieties of bags in the market these days. You'll find labeled people together with those adorable standard luggage. These days there are a lot of on the internet sellers selling bags along with purses. If you intend to acquire a fresh bag or maybe a completely new tote, subsequently these guidelines beneath will truly help you find sizzling deals with the net market place these days.There are many forms of bags out there currently. To begin with you start acquiring just about any kind of bag, it is vital that you know the various forms of bags along with its uses. By doing this surely you will pick the best one who may match your family needs.Here are the kinds of bags to pick from.Tote bagsThis sort of bag is wonderful for carrying substantial and also objects. It can be perfect as it were go to the seashore or even should have your children all-around on a trip. It's going to supply you with big place http://www.hermesbeltsbirkinkellybag.co.uk/ for the items. Commonly this type of bag can be purchased in canvas materials.HandbagsThere a variety of types of handbags presented on the market nowadays. There are individuals created from purple velvet and also satin resources that happen to be utilized for the duration of events. There are also handbags which might be constructed from synthetic leather components and will supply you great benefits during your day-to-day travel.Travelling bagWhen picking out going bags, it is essential that you obtain the best one. Because you will likely be with it to cart every one of material, make sure that you make the most tough one particular. You can find scorching bargains on exploring bags which you'll absolutely find in almost all internet stores today.KnapsackThis specific sort of bag is often used by adolescents. It is a wonderful ag which you can use to transport your own institution resources including laptop computers, markers, publications along with items you use within institution. It is extremely flexible and you could invest your issues you want without the anxieties of dropping these individuals in the process.These are some of the different kinds of bags which you can select. However prior to buying a single, ensure that it is created from resilient resources. Select the value presented in order not to spend over our limits.Bear under consideration that we now have numerous web stores in addition to merchants selling fresh and secondly hands stuff like bags along with other add-ons. It is necessary that you ultimately choose the correct one that could complement your decision, requirements and spending budget. Using this, you will surely obtain the best offer at any time!

Comment by stephanieg915 4 days ago

His or her runway series, the particular KORS brand as well as the Erina range are the 3 key prices he or she presents, while using KORS series to be the middle charge line along with the Jordan collection normally doing ladies's handbags, shoes or boots along with ready-to-wear distinct clothing.Is your hubby's party around the borders and you are puzzled exactly what to gift your guy? Are you currently going to surprise a watch? Up coming, you try to the ideal area. Properly, with the check out supporters as well as Marc Ecko watches are the ideal http://www.hermesbeltsbirkinkellybag.co.uk/ choice. The two of these check out brandnames have a huge supporter adhering to over the world. Why don't we have a rapid evaluate about these kinds of highly trendy along with cost-effective wrist watches.For just one, authentic Electric outlet timepieces provide warrantee for the buyers for example a reimbursement program extended warranty in addition to trade techniques when the buyer discover an item unsuitable or maybe it didn't fulfill your fashionable inclination. Fake wristwatches don't supply you with this method. Even though the makers of considers manufacturer's warranty which the object reaches with their clients with secured along with excellent condition, that they however give refund guarantee need to there become any damaging situation across the treating syndication. You are going to certainly recognize that that you are purchasing original examines if the car dealerships acquire insurance policy.The well known ceramic timepieces for females from this range consists of an incredible mother-of-pearl face that's generally studded using crystals to feature much more interest rate most of these interesting wrist watches. A few of the the majority of breathtaking wrist watches through his / her series include things like the actual MK Increased Silver Check out as well as the MK White Earthenware Designer watches with regard to Women having Mom involving Gem Dial in addition to Silver Glamour.Vital idea to produce step to envisage to together with electric digital photography is often that you just wish to correctly work together with gentle pale anytime smart. Commonly this will oftimes be drastically additional eye-catching for the vision in contrast to specially just what just about any form of type on the subject of severe illumination. The process are going to be reproduction which is actually attained by simply capturing in close proximity to sunrise, sundown, or even right after running which has a amaze. By means of dishes organizing with a screen, use one diffuser / extractor Handbags Wall plug to from a flash's rudeness.Are you actually informed about? A high level girl that in some way loves to buy groceries, you then should possibly be familiar with this specific brand name. Girls love bags, tops in addition to add-ons also if they don't have got satisfactory ability to purchase. Just as we know, women suches as' window shopping, correct?Want some thing a little a whole lot even more laid-back? Having the MK5038 model with tortoise stratum is going to make a fast paced announcement but look fantastic to your every day in addition to few days clothing. The total group and deal with are common brown along with dark tortoise protecting style, supplying the idea some really wealthy, earthy sounds. Take advantage of this with deeper eco-friendlies, cleveland browns, a melon and reds and going to glimpse outstanding.Some of the very most familiar symptoms of the initial DKNY timepieces or maybe various other high-end timepieces will be your money. For anyone who is agreed to get a comparatively lesser along with astonishingly low priced price ased averse to it's monatary amount, after that you ought not go lower for that present. You will discover DKNY understands that usually are marked down this also ought to certainly not bigger picture via fabricated kinds. Legitimate timepieces have recognition amounts, assurance, reimbursement, or maybe money-back extended auto warranties. Should the inexpensive wrist watches for sale for you do not possess many of these, never while attempt to search for the merchandise or you will finish upward having an man-made in addition to undependable view.

Comment by stephanieg915 4 days ago

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-boutique-en-ligne_184.html

http://www.canadagoosefemmehomme2016.fr/macmillan-canada-goose_270.html

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

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-new-york-price_202.html

http://www.canadagoosefemmehomme2016.fr/vetement-goose-canada_345.html

http://www.canadagoosefemmehomme2016.fr/veste-canada-goose-solde_198.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/manteau-comme-canada-goose_226.html

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-chateau-parka_247.html

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

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

http://www.canadagoosefemmehomme2016.fr/revendeur-canada-goose_106.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-site-officiel_188.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-pour-b��b��_146.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/acheter-doudoune-canada-goose_258.html

http://www.canadagoosefemmehomme2016.fr/promo-canada-goose_263.html

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

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-paris-magasin_420.html

Comment by sguerra376 1 day ago

www.canadagoosefemmehomme2016.fr/logo-canada-goose_138.html

www.canadagoosefemmehomme2016.fr/canada-goose-laval_347.html

www.canadagoosefemmehomme2016.fr/canada-goose-kensington_86.html

www.canadagoosefemmehomme2016.fr/doudoune-femme-canada-goose-pas-cher_407.html

www.canadagoosefemmehomme2016.fr/forum-canada-goose_60.html

www.canadagoosefemmehomme2016.fr/acheter-doudoune-canada-goose_258.html

www.canadagoosefemmehomme2016.fr/canada-goose-parajumpers_49.html

www.canadagoosefemmehomme2016.fr/boutique-canada-goose_378.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-officiel_380.html

www.canadagoosefemmehomme2016.fr/canada-goose-prix_56.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-femme-trillium_201.html

www.canadagoosefemmehomme2016.fr/canada-goose-solaris_107.html

www.canadagoosefemmehomme2016.fr/manteau-canada-goose-homme-pas-cher_341.html

www.canadagoosefemmehomme2016.fr/chilliwack-canada-goose_485.html

www.canadagoosefemmehomme2016.fr/canada-goose-paris-magasin_420.html

www.canadagoosefemmehomme2016.fr/canada-goose-longue-homme_301.html

www.canadagoosefemmehomme2016.fr/manteau-canada-goose-homme_279.html

www.canadagoosefemmehomme2016.fr/skreslet-parka-canada-goose_469.html

www.canadagoosefemmehomme2016.fr/une-canada-goose_222.html

www.canadagoosefemmehomme2016.fr/doudoune-goose-canada_292.html

www.canadagoosefemmehomme2016.fr/parajumpers-canada-goose_203.html

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-femme-noir_114.html

Comment by sguerra376 1 day ago

www.canadagoosefemmehomme2016.fr/manteau-canada-goose-homme-pas-cher_341.html

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

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

www.canadagoosefemmehomme2016.fr/canada-goose-payer-en-plusieurs-fois_152.html

www.canadagoosefemmehomme2016.fr/canada-goose-modele-victoria_409.html

www.canadagoosefemmehomme2016.fr/canada-goose-femme-trillium_201.html

www.canadagoosefemmehomme2016.fr/canada-goose-authentique_434.html

www.canadagoosefemmehomme2016.fr/parka-goose-canada_46.html

www.canadagoosefemmehomme2016.fr/selkirk-canada-goose_77.html

www.canadagoosefemmehomme2016.fr/prix-d-une-doudoune-canada-goose_390.html

www.canadagoosefemmehomme2016.fr/snow-mantra-canada-goose_155.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-femme-occasion_262.html

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

www.canadagoosefemmehomme2016.fr/expedition-parka-canada-goose_210.html

www.canadagoosefemmehomme2016.fr/site-officiel-de-canada-goose_435.html

www.canadagoosefemmehomme2016.fr/canada-goose-cramoisi_47.html

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

www.canadagoosefemmehomme2016.fr/doudoune-style-canada-goose-femme_388.html

www.canadagoosefemmehomme2016.fr/canada-goose-bomber-chilliwack_119.html

www.canadagoosefemmehomme2016.fr/kensington-canada-goose_234.html

www.canadagoosefemmehomme2016.fr/canada-goose-taille-grand-ou-petit_112.html

www.canadagoosefemmehomme2016.fr/blouson-goose-canada_195.html

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-femme-pas-cher_65.html

Comment by sguerra376 1 day ago

www.canadagoosefemmehomme2016.fr/canada-goose-chateau-parka_247.html

www.canadagoosefemmehomme2016.fr/ontario-canada-goose_96.html

www.canadagoosefemmehomme2016.fr/parka-canada-goose-montebello_214.html

www.canadagoosefemmehomme2016.fr/expedition-parka-canada-goose_210.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-style_105.html

www.canadagoosefemmehomme2016.fr/doudoune-goose-canada_292.html

www.canadagoosefemmehomme2016.fr/canada-goose-fourrure-amovible_71.html

www.canadagoosefemmehomme2016.fr/snow-mantra-canada-goose_155.html

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

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

www.canadagoosefemmehomme2016.fr/ou-acheter-une-doudoune-canada-goose_348.html

www.canadagoosefemmehomme2016.fr/canada-goose-champs-elysees_360.html

www.canadagoosefemmehomme2016.fr/boutique-canada-goose-france_117.html

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-homme-pas-cher_426.html

www.canadagoosefemmehomme2016.fr/canada-goose-blanche_295.html

www.canadagoosefemmehomme2016.fr/canada-goose-chilliwack-bomber_273.html

www.canadagoosefemmehomme2016.fr/canada-goose-femme-bleu-marine_151.html

www.canadagoosefemmehomme2016.fr/macmillan-canada-goose_270.html

www.canadagoosefemmehomme2016.fr/doudoune-style-canada-goose-femme_388.html

www.canadagoosefemmehomme2016.fr/canada-goose-promo_172.html

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

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

www.canadagoosefemmehomme2016.fr/canada-goose-rundle_453.html

www.canadagoosefemmehomme2016.fr/canada-goose-blouson-aviateur-chilliwack-homme_321.html

Comment by sguerra376 19 hours ago

http://www.canadagoosefemmehomme2016.fr/canada-goose-grise-homme_468.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-grise-femme_269.html

http://www.canadagoosefemmehomme2016.fr/acheter-doudoune-canada-goose_258.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/kensington-canada-goose_234.html

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

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

http://www.canadagoosefemmehomme2016.fr/gants-canada-goose_312.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/nouvelle-canada-goose_193.html

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-dawson-parka_374.html

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

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

http://www.canadagoosefemmehomme2016.fr/doudoune-longue-canada-goose_447.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-modele-victoria_409.html

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

http://www.canadagoosefemmehomme2016.fr/manitoba-canada-goose_482.html

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

Comment by sguerra376 57 minutes ago

Your point of view

You must be signed in to comment.