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

dd with progress bar and statistics

Terminal - dd with progress bar and statistics
sudo dd if=/dev/sdc bs=4096 | pv -s 2G | sudo dd bs=4096 of=~/USB_BLACK_BACKUP.IMG
2010-07-28 22:39:46
User: BruceLEET
Functions: dd sudo
dd with progress bar and statistics

This command utilizes 'pv' to show dd's progress.

Notes on use with dd:

-- dd block size (bs=...) is a widely debated command-line switch and should usually be between 1024 and 4096. You won't see much performance improvements beyond 4096, but regardless of the block size, dd will transfer every bit of data.

-- pv's switch, '-s' should be as close to the size of the data source as possible.

-- dd's out file, 'of=...' can be anything as the data within that file are the same regardless of the filename / extension.


There are 2 alternatives - vote for the best!

Terminal - Alternatives
sudo dd if=/dev/sdc bs=4096 | pv -s `sudo mount /dev/sdc /media/sdc && du -sb /media/sdc/ |awk '{print $1}' && sudo umount /media/sdc`| sudo dd bs=4096 of=~/USB_BLACK_BACKUP.IMG
export BLOCKSIZE='sudo blockdev --getsize64 /dev/sdc' && sudo dd if=/dev/sdc bs=1MB | pv -s $BLOCKSIZE | gzip -9 > USB_SD_BACKUP.img.gz
2013-02-05 18:10:25
User: hur1can3
Functions: dd export gzip sudo

This is a useful command to backup an sd card with relative total size for piping to pv with a progressbar

dd if=FILE | pv -s $(stat FILE | egrep -o "Size: [[:digit:]]*" | egrep -o "[[:digit:]]*") | dd of=OUTPUT
2011-02-09 22:21:06
User: andrepuel
Functions: dd egrep stat

Will automatically take the size of the file but longer, usefull only if in an function.

Know a better way?

If you can do better, submit your command here.

What others think

what about getting the filesize with stat instead of specifying manually?

Comment by izaac 338 weeks ago

You can get the filesize a number of ways. Stat, ls, du, etc. I should really download pv.

Comment by kaedenn 337 weeks and 6 days ago

can you get the size of a disk, i.e. /dev/sda, with stat?

Comment by BruceLEET 337 weeks and 5 days ago
fdisk -l /dev/sda

will work, but you might need to use sed to get the info.

Comment by matthewbauer 337 weeks ago

Any womans search can be partial without having a handbag. It is the tiny delight of which carries the requirements of which assist the woman's in leaving behind an everlasting perception. This can be the demand for the actual time. Nowadays world of fashion, designers have become particularly innovative with a great deal to offer to every one the structure divas as well as shoppers. If you buy handbags on the web, you are able to investigate your visually eye-catching variety and discover some thing excellent with a pocket welcoming value.If you're keen on participating celebrations, you will be aware that the wardrobe is imperfect without worrying about best handbag. In your day to day life, they're necessary too. Nevertheless, for just a great celebration it's possible to decide on clutch system bags. They can be small, along with underrate the huge influence they may have on the dresser as well as your appear also. These people symbolise beauty, however, you may also have a number of that are peculiar and also cute. In order to develop a assertion, just be sure you select one that has a special condition and several distinct behaviour. It is far better being resourceful in comparison with follow the conventional trend.When you are looking at most of these treats, fluorescent is the coloration that's fairly modern. Its dynamics brightens right up a monotonous closet. You can even decide on many out of the box images. Take pleasure in this kind of if you have the dress as well as that you can take it. Should you not unique this outfit, you could end up enacting the faux pas. Some people might not have an excessive amount information about style. When this occurs, purchase handbags on-line. Read many sites and also recommendations. It will be a fully unique knowledge. Special discounts as well as sorts of schemes will surely expand your laugh.The notion is always to enhance the fashion quotient. Should you go for a normal style and design, your goal will never be completed. Sequins as well as an wonderful style may boost the standard of their particular search. Adornments will always be welcome. You must know the size way too. Do not go for extra-large clutch i465 black bags. They have to really make the female look smaller. One more standard stage is your fingers really should be well-kept. The hands will almost always be displayed, thus damaged fingernails will definitely definitely not operate in your like. Be sure that you have the excellent one that will improve the seriously issue http://www.hermesbeltsbirkinkellybag.co.uk/ of your respective seem.Follow these guidelines, and you should certainly not make a complaint of an undesirable curly hair evening. Ladies need to comprehend of which accessorising their wardrobe will be essential. That concludes the style and you will certainly jump out between the audience. That is simply with regards to vogue add-ons is the fact there will be something for those sorts of ladies. If you do not just like created ones, invariably you could select simply ones throughout brilliant shades. It is not necessary that will everything is appropriate for all women. So, make use of your foresight and acquire the best one on your attire. It is a personal assurance as well as mind-set of which tap out model.

Comment by stephanieg915 2 days ago




























Comment by sguerra376 2 hours ago

Your point of view

You must be signed in to comment.