Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Copying certain subdirectories retaining structure
- X-seq: zsh-users 18502
- From: Philippe Troin <phil@xxxxxxxx>
- To: zzapper <david@xxxxxxxxxxxxxx>
- Subject: Re: Copying certain subdirectories retaining structure
- Date: Sat, 22 Feb 2014 13:40:12 -0800
- Cc: zsh-users@xxxxxxx
- In-reply-to: <XnsA2DCCC96A9968davidrayninfocouk@80.91.229.13>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <XnsA2DCCC96A9968davidrayninfocouk@80.91.229.13>
On Sat, 2014-02-22 at 20:06 +0000, zzapper wrote:
> I want to copy all files in subdirectories named /good/ to a USB while
> retaining directory structure
>
> /aaa/pic/good
> /aan/dogs/good/
> /dir1/dir2/dir3/good/
for i in **/good(/)
do
dest=/media/usbkey/$i
mkdir -p $i:h
cp -a $i /media/usbkey/$i
done
Phil.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author