How to copy with cp to include hidden files and hidden directories and their contents?

Case 1

(Note that /home/user must not exist already, or else it will create /home/user/skel.)

Don't specify the files:

cp -r /etc/skel /home/user

Case 2

Lets say you created the new folder (or are going to create one) and want to copy the files to it after the folder is created

mkdir /home/<new_user>
cp -r /etc/skel/. /home/<new_user>

Case 3

mv /source/path/{.[!.],}* /destination/path

Source

Etiquetas