Merge folder contents in OSX/*nix


Re: Merge folder contents in OSX/*nix
#5
Allen Smith Wrote:
Jean-Philippe Ouellet Wrote:
Code:
$ cp -r parts LDraw

Unfortunately, that solution is insufficiently versatile for my day-to-day needs, in which I frequently need to copymerge the *contents* of one directory into the *contents* of another. Using cp requires that a) the two folders being merged have exactly the same names and b) that you specify the parent of the destination as the destination path. For me, (a) is frequently untrue, and (b) is always inconvenient.

At least on the Mac, this can be avoided by appending / to the source directory name (and not the desination directory name). Like so:

Code:
cp -R NewLDraw/ ~/Libraray/ldraw

The above will merge the NewLDraw directory contents with the ~/Library/ldraw directory contents.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: Merge folder contents in OSX/*nix - by Travis Cobbs - 2012-01-24, 21:34

Forum Jump:


Users browsing this thread: 1 Guest(s)