Copy specific files recursively using the same tree organization.

rsync -vd --files-from=<(find . -name entries -print ) . ../target_directory
This command has been used to overwrite corrupted "entries" files of a corrupted subversion working copy. Note the --files-from input format.

By: samyboy
2010-01-26 09:41:12

What Others Think

I guess that this construct: creates a temporary file that rsync is using? It's very neat - do you know how this feature is called? It also seems bash-specyfic, it didn't work in zsh - do you know the equivalent for zsh?
zabuch · 654 weeks and 2 days ago
I found this syntax browsing the web. I guess it's bash specific. I don't know zsh enough sorry :( Actually there is no temporary file because rsync gets the list directly from the find command. It's a cool quick and dirty one-liner, However I don't consider it safe to use it in a script. If I where smart would do something like this: TMPFILE=$(mktemp -t filelist.XX) find . -name a -print0 > $TMPFILE rsync -vd --from0 --files-from=$TMPFILE . ..dest /bin/rm $TMPFILE
samyboy · 653 weeks and 6 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* ?
Edward · 634 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands

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.


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: