MLUG: Re: [MLUG] copying many trees together
Re: [MLUG] copying many trees together
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I was thinking if you have a lot of directories with foo as a subdirectory, you might want to use find like this:

#!/bin/bash
for i in `find ./ -maxdepth 2 -name 'foo'`
do
   cp -rp $i X/.
done

I think that will find any direcory in the current directory that has a subdirectory of foo at its next level and copy it to X/

That way you don't need to know each directory you want to check for foo.

Russell


_______________________________________________ members mailing list EMAIL:PROTECTED http://mlug.missouri.edu/mailman/listinfo/members