[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What's the easiest way to move some files in a directory tree?

On Fri, Feb 13, 2004 at 01:15:37PM -0500, Darin Strait wrote:
> Hello.
> I have a large directory tree, with scores of end nodes. Each end node in the 
> tree has a number of files whose names end either in .mp3 or in .flac. 
> I would like to copy the directory structure of the tree, but I want to move 
> files that end in .mp3 to the new tree and leave the .flac files behind.
> What is the easiest way to do that? I was looking at unision, but unison seems 
You can use tar and find/rm (make sure you verify before rm files):

	mkdir copyfoo
	(cd foo/; tar cf - . ) | (cd copyfoo/; tar xvf - *mp3)
	find foo/ -name *.mp3 -exec rm \{\} \;


Chris Harris <charris@rtcmarketing.com>
GNU/Linux --- The best things in life are free.

Reply to: