How to copy a directory with all subfolder/files to a new destination

  • Option A
    You can copy the content of a folder /theme to another existing folder /Theme with the command

    cp -a /theme/. /Theme/

    The -a option is a recursive option, that help you keep all file attributes.

    The . at end of the source path is a specific cp syntax that allow you to copy all files and (sub-)folders, included hidden ones.

  • Option B
    You can use cpio for this action.

    # find /theme | cpio -vdump /Theme

    Options -v = verbose dump = ensure all files inclusive all correct rights and permissions are copied.

Have Fun,
Ubuntix

Leave a Reply

Your email address will not be published. Required fields are marked *