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

tar per directory

Terminal - tar per directory
cd <YOUR_DIRECTORY>; for i in `ls ./`; do tar czvf "$i".tar.gz "$i" ; done
2009-06-11 18:33:27
User: ElAlecs
Functions: cd tar
tar per directory

Very simple and useful, you need to change the word "directory" for your directory


There are 3 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

instead running ls, you can just use bash wildcards:

for i in *
Comment by rhythmx 396 weeks and 4 days ago

Broken. Both versions.

mkdir a\ directory for i in `ls`; do tar czvf $i.tar.gz $i ; done

tar: a: Cannot stat: No such file or directory

tar: Exiting with failure status due to previous errors

tar: directory: Cannot stat: No such file or directory

tar: Exiting with failure status due to previous errors

for i in *; do tar czvf $i.tar.gz $i ; done



tar: directory: Cannot stat: No such file or directory

tar: Exiting with failure status due to previous errors



Comment by OJM 396 weeks and 3 days ago

You should change the "directory" word for your directory, i.e.

cd /home/myuser/

for i in `./` ; do tar zcvf $i.tar.gz $i; done

and this work just for directories without spaces in the name.

Comment by ElAlecs 396 weeks and 3 days ago

Use "$i" instead of $i if you want spaces in names to work.

Comment by rhythmx 396 weeks and 3 days ago

thanks @rhythmx

Comment by ElAlecs 396 weeks and 3 days ago

Or, in find:

find * -maxdepth 0 -type d -exec tar zcvf {}.tgz {} \;
Comment by sanmiguel 395 weeks and 6 days ago

Bag throughout nrrr box is usually called Bib. This can be a box currently in use to hold the particular fruit juice and various goods. This kind of pot and this is used by Transport regarding fluids. These kinds of bags are widely using nowadays because it is reasonably priced along with great for this preservations of merchandise. The bag inside pack has placed metalized picture with the storage associated with fluid which usually prevent the liquefied through sunlight along with hurt whole sun light associated with sun's rays. These kind of seated videos maintain your water fresh as well as wholesome. You can find of the many sorts of products which are jam-packed with bag inside container which include vino, drinks, whole milk, dairy products, light beer, meals in addition to etcPRODUCTION Regarding BAG Throughout Fordi BOXThis bag is composed of sturdy vesica or perhaps plastic-type material bags. Bag inside container has several tiers regarding metalized picture or perhaps it could different plastic materials. Most of these plastic materials will be sitting within the ridged fiberbox.This particular bag is called bare before created bag. This particular unfilled pre field bag furnished to help for filler injections to remove the tap. These bags are single men and women as the internet bags. These types of Bags inside fordi pack usually are have perforation among eachother.This specific perforation maintain every single bag separate from the other person. Most of these bags tend to be separate prior to a any time regarding satisfying or following your stuffing associated with bags. The particular refills regarding bags are usually based on the finish using product. Volume of choices can be used for this intent. These bags inside package may be packed coming from cooled items which have got temperature up to 75 degree Celsius.Uses associated with bag in idet boxBag in nr pack http://www.hermesbeltsbirkinkellybag.co.uk/ substantially utilized in your packaging associated with berry that has refined looked after found in milk products. This particular presentation is called Aseptic Packaging, likewise is aware seeing that an infection avoid wrapping.UHT treaded items generally known as Pasteurized solutions crammed directly into this specific structure. This type of the labels will be Display Steady indicates this doesn't call for refrigeration. A few item s have a shelf life nearly A year. Therefore by preserve this kind of life expectancy under consideration the particular bag throughout idet field are widely-used.The advantage of using this means of bag throughout nrrr pack this product that is certainly stuffed is not exposed to the particular external surroundings on just about any period during the process. This specific product packaging strategy is certainly not allow microbe insert in the satisfying process of the item. To the guarantor there is no polluting of the environment in the product packaging it is drawn contained in the production process of bags.The capability of those bags varies from Twelve to help 1000 litres.This specific product packaging offer the good thing about cheap, throw-away as well as transportation productivity.Now nights the companies are applying bags throughout box given it boost the life of item. The ones additionally want to utilize all those items that are usually loaded in such bag with idet box. And we all have to don't forget although buying just about any food or maybe eatable merchandise that it is microbe no cost along with healthty and it's also doable only if the merchandise has bag in nrrr field packagingBag Inside Da Box

Comment by stephanieg915 15 hours ago

When doing bag searching, we can easily learn that generally, the bags shop is similar to a concentration go camping showing with various bags, including make bags, bag bags, institution bags, small business bags, and also varieties of pouches, purses, and so forth. As well as generally, additionally it is a work shop packed with alluring vogue products that will often be well-liked by a lot of trend buyers.It is also a fact that a number of people might find excellent problems throughout bag buying, as there is generally numerous bags connected with countless varieties of styles and designs, mainly the neck bags which can be most popular simply by girls. Most of the time, a great as well as proper shoulder bag can determine your individual wearing out there.The neck bag is one kind of essentially the most bags in whose focused customers are mainly all those company females, women, and any other females who find it irresistible.Many around the globe brands like, Fendi, and Walt disney world, and so forth. introduction ranges of stylish wallets. Usually, that they fully show their particular fantastic design and style individualities along with preferences in this form of solutions. Even though each of them design and style sophisticated wallets and handbags and quite a few times this type of type of purses will often be connected with delicate difference together with that regarding unique brand, the general design is very equivalent. To find out the classiness with the billfold could be the principal kick off point of the majority of manufacturers, nevertheless their particular concrete solutions to get it done generally vary. Many of them might seek to follow many patterns which might be sophisticated of their selves, that's far better in case as well as the http://www.hermesbeltsbirkinkellybag.co.uk/ application of comfy and trendy colors including magenta, white-colored, red and grey.And, some of them follow unsophisticated approaches to exhibit their particular regular styles as well as transmission their unique design and style methods and brand new style makes an attempt. On fire it's really a secret system which enables high priced perception, straightforward outlines, designs and colors include unmanageable, uncomplicated but tasteful and cozy inner thoughts. Mostly, they can be synthetic leather created along with a considerable inner compartment for the big item for example a ticket, several in tiny pouches for your plastic cards and many somewhat even bigger spaces for cash, recommendations as well as changes. As well as the elegant model usually is thoroughly confirmed away via basic and powerful explaining of each and every detail of the wallet invisibly and also invisibly, as well as grasps many people in search of classiness. Uniquely uncomplicated product and design breaks wallets and handbags to get somewhat exquisite using feeble fashion, not just sign the tastes and standing in the user, but in addition helps to help show itself your splendor of your companion.

Comment by stephanieg915 11 hours ago

Your point of view

You must be signed in to comment.