mkdir backupcache    cp -rp .cache backupcache # or cp -rp \.cache backupcache does not worknothing gets copied and directory backupcache remains empty
How can I copy a hidden directory recursively and preserving its permissions?
command line;files;cp
Don't specify the files or DirectoryLets say you created the new folder (or are going to create one) and want to copy the files to it after the folder is createdmkdir /test/foldercp -rp /path/to/copy/. /test/folderThis will copy all files/folder recursively from /path/from/copy in to the already existing folder created on the first line.Another approach is tar. For example:$cd foo$tar cf - . | tar -C /path/to/bar -xUsing rsync :rsync -av src dest