print only first level directory name when copying files

Fourhundred Thecat 400thecat at gmx.ch
Fri Aug 4 07:15:58 UTC 2023


 > On 2023-08-04 06:13, Perry Hutchison wrote:
> Perry Hutchison via rsync <rsync at lists.samba.org> wrote:
>
> On second thought, that grep will match any directory name having 3
> *or more* levels.  This:
>
>    rsync --info=name1,del2 -rl /mnt/foo /mnt/bar/ | egrep '^/[^/]*/[^/]*/[^/]*/$'
>
> should match only those with exactly 3 levels.

I think that should work!

thank you



More information about the rsync mailing list