|
From: | Todd Andrews |
Subject: | Re: New feature request for cp to flatten directory |
Date: | Thu, 13 Dec 2007 07:45 -0800 (PT) |
User-agent: | Thunderbird 2.0.0.4 (Windows/20070604) |
Thu 12-13-07 07:45 amThanks to everyone who replied! I should have explained more fully my reasons for making the suggestion:
1) The command line using find gets a bit complicated when you need to take into account file names with spaces, quotes, etc.
Using a variation on what Pádraig Brady sent will take care of this:find data -type f -print0 | xargs -r0 cp -av --backup=numbered --target-directory=alldata
2) Eric wrote, "Thanks for the suggestion. However, it seems like this is already possible with existing tools, so why add the bloat?"
Because I'm sure you'd agree having to use find + xargs + cp is not very intuitive compared with "cp -pr --flatten data -t alldata"
Thanks for listening to my suggestion anyway!
[Prev in Thread] | Current Thread | [Next in Thread] |