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

rsync + find

Terminal - rsync + find
rsync -avz -e ssh --files-from=<(find -mtime +30 -mtime -60) source dest
2009-03-13 12:58:28
User: voyeg3r
Functions: find rsync ssh
6
rsync + find

rsync from source to dest all between >30

Alternatives

There are 3 alternatives - vote for the best!

Terminal - Alternatives
find . -name "whatever.*" -print0 | rsync -av --files-from=- --from0 ./ ./destination/
2009-10-15 20:06:38
User: syssyphus
Functions: find rsync
11

use find with rsync

find /src/dir/ -mtime -10 -printf %P\\0|rsync --files-from=- --from0 /src/dir/ /dst/dir/
2011-01-18 22:23:47
User: pauli
Functions: find rsync
Tags: find rsync
1

'-mtime -10' syncs only files newer 10 days (-mtime is just one example, use whatever find expressions you need)

printf %P: File's name with the name of the command line argument under which it was found removed.

this way, you can use any src directory, no need to cd into your src directory first.

using \\0 in printf and a corresponding --from0 in rsync ensures that even filenames with newline characters work (thanks syssyphus for #3808).

both, #1481 and #3808 just work if you either copy the current directory (.) , or the filesystem root (/), otherwise the output from find and the source dir from rsync just don't match. #7685 works with an arbitrary source directory.

Know a better way?

If you can do better, submit your command here.

What others think

While useful in a few cases, explicitly specifying a modification time range misses the point of rsync.

Comment by citybadger 403 weeks and 2 days ago

Anybody know, how to combine

rsync -v --files-from=

and

find `cat /path/to/list.lst`

list.lst contains for example

path/to/*dir/dir/

path/to/*dir/filename*

path/to/another/dir*/filename*

?

Comment by Edward 337 weeks and 6 days ago

Note that --files-from disables recursive behavior for "-a". From the man page: "The only exception to the above equivalence is when --files-from is specified, in which case -r is not implied."

So to copy directories beginning with capital A from /tmp to /var/tmp recursively:

find /tmp/ -mindepth 1 -maxdepth 1 -name 'A*' -printf %P\\0 | rsync -r --progress --files-from=- --from0 /tmp/ /var/tmp/
Comment by felixhummel 199 weeks and 6 days ago

http://www.oakleyvault.us.com/

http://www.oakley--sunglasses.com.co/

http://www.oakleysunglassesoutlet.us.org/

http://www.oakleysunglasses1.us.com/

http://www.oakleysunglasses.com.co/

http://www.raybans.name/

http://www.ray-ban-sunglass.us.com/

http://www.rayban--sunglasses.org/

http://www.polo-ralph-lauren.us.com/

http://www.polo-ralph-lauren-outlet.us.com/

http://www.burberry-outlet-store.us.com/

http://www.burberryoutlet-store.us.com/

http://www.michaelkors-outlet-online.us.org/

http://www.outletonline-michaelkors.com/

http://www.michaelkors-outlet-online.us.com/

http://www.michael-korsoutlet.in.net/

http://www.michaelkors-outlet-store.us.com/

http://www.michaelkors-handbags.in.net/

http://www.uggs-outletboots.in.net/

http://www.uggsoutlets.us.com/

http://www.uggs-outlet.in.net/

http://www.cheapuggboots.in.net/

http://www.cheap-uggs.in.net/

http://www.louisvuitonoutlet.us.com/

http://www.louisvuitton-outlets.org/

http://www.louisvuitton.ar.com/

http://www.louisvuitton-outlet-store.com/

http://www.louis-vuittonhandbags.org/

http://www.redbottoms.in.net/

http://www.christianlouboutin-outlet.in.net/

http://www.christian-louboutin-shoes.in.net/

http://www.christian-louboutin.org.uk/

http://www.rolexreplicawatches.us.com/

http://www.replica--watches.com/

http://www.air-jordanshoes.net/

http://www.nike--outlet.com/

http://www.toryburch-outletonline.in.net/

http://www.guccioutletsonline.us.com/

http://www.prada-handbags.us.com/

http://www.prada-outlets.in.net/

http://www.longchamp-outlet.in.net/

http://www.longchamphandbags.in.net/

http://www.longchamphandbagsoutlet.us.com/

http://www.tiffanyandco1.us.com/

http://www.tiffanyandco-jewelry.us.com/

http://www.nikeairmaxinc.net/

http://www.nikeair-max.net/

http://www.nike-freerun.com/

http://www.chanel-handbags-outlet.in.net/

http://www.katespadeoutlets.cc/

http://www.katespade-handbags.in.net/

http://www.coachoutlet-online.in.net/

http://www.coachfactory-outletonline.in.net/

http://www.coachoutletstoreonline.jp.net/

http://www.coachpurse.in.net/

http://www.true-religionoutlet.in.net/

http://www.truereligionjeansoutlet.us.com/

http://www.truereligionoutlets.in.net/

http://www.cheaptruereligion.us.com/

http://www.nike-airmax-pas-cher.fr/

http://www.nikeair-max.fr/

http://www.airjordanpas-cher.fr/

http://www.nikefreerun.fr/

http://www.nike-roshe-run.fr/

http://www.sac-longchamp-pas-cher.fr/

http://www.sac--longchamps.fr/

http://www.poloralphlauren-pascher.fr/

http://www.louboutin-pas-chere.fr/

http://www.sac-michaelkors-pascher.fr/

http://www.sac-burberry-pascher.fr/

http://www.lunette-oakley-pascher.fr/

http://www.lunette-rayban-pas-cher.fr/

http://www.hollister-abercrombiefitch.fr/

http://www.sachermes.fr/

http://www.vanspas-cher.fr/

http://www.timberland-paschere.fr/

http://www.newbalancesoldes.fr/

http://www.converse-pas-cher.fr/

http://www.the-north-face.fr/

http://www.niketnrequin-pascher.fr/

http://www.polo-lacoste-pascher.fr/

http://www.nikeblazerpaschere.fr/

http://www.nikeair-force.fr/

http://www.sac-guesspascher.fr/

http://www.sac-vanessa-bruno.fr/

http://www.scarpehogan--outlet.it/

http://www.rayban-sunglasses.me.uk/

http://www.michaelkorshandbags-uk.org.uk/

http://www.michaelkors-outlet-canada.ca/

http://www.michael--korsoutlet.ca/

http://www.lululemon-outlet-canada.ca/

http://www.hollistersale.org.uk/

http://www.thenorth--face.co.uk/

http://www.mulberryhandbagsoutlet.co.uk/

http://www.ralphlauren-outlet.co.uk/

http://www.nike--airmax.co.uk/

http://www.nikeairmax.org.uk/

http://www.nike-free-run.org.uk/

http://www.abercrombie-and-fitch.org.uk/

http://www.nike-roshe-run.org.uk/

http://www.nike-trainers.org.uk/

http://www.nike-air-huarache.co.uk/

http://www.longchampbags.org.uk/

http://www.hollister-abercrombie.es/

http://www.vans-shoes-outlet.com/

http://www.nikerosherun.net/

http://www.maccosmeticsoutlet.us/

http://www.abercrombie-andfitch.us.com/

http://www.hermesbirkinbags.com.co/

http://www.the-northfaceoutlet.us.com/

http://www.the-north-face.in.net/

http://www.newbalance-shoes.in.net/

http://www.reebok-outlet.in.net/

http://www.lululemonoutlets.in.net/

http://www.nfljerseys-cheap.us.com/

http://www.cheap-wedding-dresses.org/

http://www.beatsbydrdreheadphones.in.net/

http://www.mont-blanc-pens.us.com/

http://www.ferragamo-shoes.net/

http://www.giuseppe-zanotti.in.net/

http://www.instylerionicstyler.us.com/

http://www.babyliss.in.net/

http://www.mcm-handbags.net/

http://www.chiflatiron.cn.com/

http://www.insanityworkout.in.net/

http://www.ghdhair-straighteners.org.uk/

http://www.bottegaveneta-handbagsoutlet.com/

http://www.valentino-shoes.us.com/

http://www.herveleger.us/

http://www.asicso.com/

http://www.soccer--shoes.net/

http://www.soccerjerseys.com.co/

http://www.celine-handbags.org/

http://www.p90x3workout.us.com/

http://www.jimmychoo-shoes.us.com/

http://www.hollister-clothingstore.us.com/

http://www.nike-airmax.nl/

http://www.baseball-bats.us/

http://www.iphonecase.us.com/

http://www.timberland-boots.us/

http://www.occhiali-oakley.it/

http://www.christian--louboutin.it/

http://www.ralphlauren-outlet.it/

http://www.abercrombiehollister.it/

http://www.nikeair-max.it/

http://www.vansscarpe.it/

http://www.converse-allstar.it/

http://www.borse--gucci.it/

http://www.rayban--occhiali.it/

http://www.converse--shoes.com/

http://www.saclancelpascher.fr/

http://www.toms--shoes.net/

http://www.montrespas-cher.fr/

http://www.karenmillen.me.uk/

http://www.supra--shoes.com/

http://www.juicycoutureoutlet.jp.net/

http://www.juicycoutureoutlet.com.co/

http://www.marcjacobsoutlet.us/

http://www.cheapweddingdresses.org.uk/

http://www.replica--watches.co.uk/

http://www.hollister--canada.ca/

http://www.pandora-jewelry.us.com/

http://www.pandorajewelrys.us.com/

http://www.pandora--charms.in.net/

http://www.pandora--charms.org.uk/

http://www.linksoflondon.me.uk/

http://www.thomas-sabo-uk.org.uk/

http://www.swarovski-jewelry.in.net/

http://www.swarovski.me.uk/

http://www.bottesugg-pas-cher.fr/

http://www.ugg-pas-cher.fr/

http://www.ugg-boots-uggs.co.uk/

http://www.ugg--australia.it/

http://www.uggs-canada.ca/

http://www.louisvuittonpas-cher.fr/

http://www.louisvuitton-sac.fr/

http://www.louis-vuitton-handbags.org.uk/

http://www.louisvuitton-canada.ca/

http://www.borse-louis-vuitton.it/

http://coachofficialsite.blog.com/

http://www.canadagoose.net.co/

http://www.canada-goose-jackets.us.com/

http://www.canada-goose-outlet.us.com/

http://www.canadagoose--jackets.ca/

http://www.canadagoose-paschere.fr/

http://www.canada-goose.me.uk/

http://www.moncler.org.uk/

http://www.moncleroutlet.com.co/

http://www.monclerjackets.us.org/

http://www.doudoune-monclerpascher.fr/

http://www.barbour-jackets.org.uk/

http://www.moncler--outlet.it/

http://www.canada--goose.se/

http://www.moncleronline-shop.de/

http://www.moncler.org.es/

http://www.moncler.co.nl/

http://www.canadagooses.co.nl/

http://www.barbour.us.org/

http://www.oakleys-glasses.us.com/

http://www.michael-kors-outlet.us.org/

http://www.michaelkorsoutletonline-sale.us.com/

Comment by oakleysunglasses 30 weeks and 2 days ago

http://www.ultraboostuncaged.us/ Ultra Boost Uncaged

http://www.outlettoms.us/ Toms Outlet

http://www.cheap--jordanshoes.us.com/ Jordan Shoes

http://www.rayban-outlets.com/ Ray Ban Outlet

http://www.oakleyoutlet-store.us/ Oakley Outlet

http://www.longchampoutletstore.org/ Longchamp Outlet Store

http://www.yeezy.com.co/ Yeezy

http://www.kedsshoesforwomen.com/ Keds Shoes For Women

http://www.nikeoutlet.org.uk/ Nike UK

http://www.jordan4.us/ Jordan 4

http://www.nikehuarache.us/ Nike Huarache

http://www.adidasnmd.us.com/ Adidas NMD

http://www.nikeoutletfactorystore.com/ Nike Factory Outlet

http://www.mlb-jerseys.us/ MLB Jerseys

http://www.outletrayban.us/ Ray Ban Outlet

http://www.jordan12.us/ Jordan 12

http://www.ray-banoutlets.us/ Ray Bans Outlet

http://www.yeezyboost350.us.com/ Adidas Yeezy

http://www.ray-banoutlet.site/ Ray Ban Outlet Online

http://www.ralphlaurenoutletstoreonline.com/ Ralph Lauren Outlet Online

http://www.uggboots-outlets.com/ UGG Boots Outlet

http://www.underarmouroutlet.us.com/ Under Armour Outlet

http://www.yeezyboost350.us.com/ Yeezy Boost 350

http://www.nikeoutletsstore.com/ Nike Outlet Store

http://www.longchampbags.us.com/ Longchamp Bags

http://www.nikerosherun.us.com/ Roshe Run

http://www.nikeairmax.us/ Air Max

http://www.airmax2016.us.com/ Air Max 2016

http://www.yeezy-shoes.us.com/ Yeezy

http://www.nfljerseys.us/ NFL Jersey

http://www.poloralphlaurenoutlets.us.com/ Polo Ralph Lauren Outlet

http://www.adidas-uk.org.uk/ Adidas UK

http://www.timberlanduk.org.uk/ Timberland UK

http://www.ralphlaurens.org.uk/ Ralph Lauren

http://www.yeezyboost-350.org.uk/ Yeezy Boost 350

http://www.nikeoutlet.org.uk/ Nike Outlet

http://www.yeezyboost-350.in.net/ Yeezy Boost 350

http://www.rayban-sunglasses.ca/ Ray Ban Sunglasses

Comment by rboutlet1 8 weeks and 3 days ago

Your point of view

You must be signed in to comment.