[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?



Darin Strait <darin_strait@yahoo.com> writes:

> 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.

This won't mirror directories from srcdir without .mp3 files in
them, but it's a start.

   cd srcdir
   find . -name \*.mp3 \
     | tee /tmp/mp3s.list \
     | xargs tar cf - \
     | ssh user@dsthost cd dstdir \; tar xvf -
   xargs rm -f </tmp/mp3s.list

-- 
    aaraines@pobox.com (Andrew A. Raines)



Reply to: