print only first level directory name when copying files

Fourhundred Thecat 400thecat at
Fri Aug 4 02:27:58 UTC 2023


I am copying /mnt/foo to /mnt/bar/

   rsync --info=name1,del2 -rl /mnt/foo /mnt/bar/

/mnt/foo contains deep directory structure, ie:



I am not interested in details which individual files were copied, just
the main directory. Is it somehow possible for rsync to only report the
first level directory?

ie, to have output like this when copying:



More information about the rsync mailing list