Copy Hidden Directories
I used this to duplicate the majority of my home folder
every output line of ls -a is fed into egrep and filtered based on lines that start with . but do not start with .. because it is required that the line start with a . because of ^. the \ exists in order to treat the . literally and not as a wild card. Then [^.] says that the character following the first . at the beginning of the line cannot be a . . The, for each out that remains after the filter cp is ran using that output as the source and ../newHome as the destination. And finally, the -r does a recursive copy.
Caution: As I am finishing up this blog post I am wondering why my laptop is still griding away at the copy, it is because there was a ton in the trash folder which is located in .local.
Though this does work in theory for your home folder it didn't work so well, but, the idea still works for copying hidden files or even filtering the items that you wish to copy